<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFUUID",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFUUIDRef"
  },
  "title" : "CFUUID"
}
-->

# CFUUID

```
class CFUUID
```

## Overview

CFUUID objects are used by plug-ins to uniquely identify types, interfaces, and factories. When creating a new type, host developers must generate UUIDs to identify the type as well as its interfaces and factories.

UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs (Interface Identifiers), are 128-bit values designed to be unique.

The standard format for UUIDs represented in ASCII is a string punctuated by hyphens, for example `68753A44-4D6F-1226-9C60-0050E4C00067`. The hex representation looks, as you might expect, like a list of numerical values preceded by `0x`. For example, `0x68, 0x75, 0x3A, 0x44, 0x4D, 0x6F, 0x12, 0x26, 0x9C, 0x60, 0x00, 0x50, 0xE4, 0xC0, 0x00, 0x67` . To use a UUID, you create it and then copy the resulting strings into your header and C language source files. Because a UUID is expressed as an array of bytes, there are no endianness considerations for different platforms.

You can create a CFUUID object using any one of the `CFUUIDCreate...` functions. Use the [`CFUUIDGetConstantUUIDWithBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)`](/documentation/CoreFoundation/CFUUIDGetConstantUUIDWithBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)) function if you want to declare a UUID constant in a `#define` statement. You can get the raw bytes of an existing CFUUID object using the [`CFUUIDGetUUIDBytes(_:)`](/documentation/CoreFoundation/CFUUIDGetUUIDBytes(_:)) function.

## Topics

### Creating CFUUID Objects

[`CFUUIDCreate(_:)`](/documentation/CoreFoundation/CFUUIDCreate(_:))

Creates a Universally Unique Identifier (UUID) object.

[`CFUUIDCreateFromString(_:_:)`](/documentation/CoreFoundation/CFUUIDCreateFromString(_:_:))

Creates a CFUUID object for a specified string.

[`CFUUIDCreateFromUUIDBytes(_:_:)`](/documentation/CoreFoundation/CFUUIDCreateFromUUIDBytes(_:_:))

Creates a CFUUID object from raw UUID bytes.

[`CFUUIDCreateWithBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)`](/documentation/CoreFoundation/CFUUIDCreateWithBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:))

Creates a CFUUID object from raw UUID bytes.

### Getting Information About CFUUID Objects

[`CFUUIDCreateString(_:_:)`](/documentation/CoreFoundation/CFUUIDCreateString(_:_:))

Returns the string representation of a specified CFUUID object.

[`CFUUIDGetConstantUUIDWithBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)`](/documentation/CoreFoundation/CFUUIDGetConstantUUIDWithBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:))

Returns a CFUUID object from raw UUID bytes.

[`CFUUIDGetUUIDBytes(_:)`](/documentation/CoreFoundation/CFUUIDGetUUIDBytes(_:))

Returns the value of a UUID object as raw bytes.

### Getting the CFUUID Type Identifier

[`CFUUIDGetTypeID()`](/documentation/CoreFoundation/CFUUIDGetTypeID())

Returns the type identifier for all CFUUID objects.

### Data Types

[`CFUUIDBytes`](/documentation/CoreFoundation/CFUUIDBytes)

A 128-bit struct that represents a UUID as raw bytes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)