<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSAttributeType",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:@E@NSAttributeType"
  },
  "title" : "NSAttributeType"
}
-->

# NSAttributeType

The types of attribute that Core Data supports.

```
enum NSAttributeType
```

## Overview

Core Data supports the following attribute types, which differentiate between bit sizes to enable data-store independence. For some types, a scalar option is available.

|**Attribute Type**|**Type**                                                                     |**Scalar type**                                                         |**Scalar by default?**|
|------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------|----------------------|
|Integer 16        |<doc://com.apple.documentation/documentation/Foundation/NSNumber>            |<doc://com.apple.documentation/documentation/kernel/int16_t>            |yes                   |
|Integer 32        |<doc://com.apple.documentation/documentation/Foundation/NSNumber>            |<doc://com.apple.documentation/documentation/kernel/int32_t>            |yes                   |
|Integer 64        |<doc://com.apple.documentation/documentation/Foundation/NSNumber>            |<doc://com.apple.documentation/documentation/kernel/int64_t>            |yes                   |
|Double            |<doc://com.apple.documentation/documentation/Foundation/NSNumber>            |`double`                                                                |yes                   |
|Float             |<doc://com.apple.documentation/documentation/Foundation/NSNumber>            |`float`                                                                 |yes                   |
|Boolean           |<doc://com.apple.documentation/documentation/Foundation/NSNumber>            |<doc://com.apple.documentation/documentation/ObjectiveC/BOOL>           |yes                   |
|Date              |<doc://com.apple.documentation/documentation/Foundation/NSDate>              |<doc://com.apple.documentation/documentation/Foundation/TimeInterval>   |no                    |
|Decimal           |<doc://com.apple.documentation/documentation/Foundation/NSDecimalNumber>     |<doc://com.apple.documentation/documentation/Foundation/NSDecimalNumber>|no                    |
|UUID              |<doc://com.apple.documentation/documentation/Foundation/NSUUID>              |<doc://com.apple.documentation/documentation/Foundation/NSUUID>         |no                    |
|URI               |<doc://com.apple.documentation/documentation/Foundation/NSURL>               |—                                                                       |—                     |
|String            |<doc://com.apple.documentation/documentation/Foundation/NSString>            |—                                                                       |—                     |
|Binary data       |<doc://com.apple.documentation/documentation/Foundation/NSData>              |—                                                                       |—                     |
|Transformable     |<doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class>|—                                                                       |—                     |
|Composite         |—                                                                            |—                                                                       |—                     |
|Undefined         |—                                                                            |—                                                                       |—                     |

> Note:
> If your application uses Binary Large Objects (BLOBs) like image and sound data, prefer to store its binary data outside of the Core Data store.

## Topics

### Attribute types

[`NSBinaryDataAttributeType`](/documentation/CoreData/NSAttributeType/binaryDataAttributeType)

An attribute that stores binary data.

[`NSBooleanAttributeType`](/documentation/CoreData/NSAttributeType/booleanAttributeType)

An attribute that stores a Boolean value.

[`NSCompositeAttributeType`](/documentation/CoreData/NSAttributeType/compositeAttributeType)

An attribute that derives its value by composing other attributes.

[`NSDateAttributeType`](/documentation/CoreData/NSAttributeType/dateAttributeType)

An attribute that stores a date.

[`NSDecimalAttributeType`](/documentation/CoreData/NSAttributeType/decimalAttributeType)

An attribute that stores a decimal value.

[`NSDoubleAttributeType`](/documentation/CoreData/NSAttributeType/doubleAttributeType)

An attribute that stores a double value.

[`NSFloatAttributeType`](/documentation/CoreData/NSAttributeType/floatAttributeType)

An attribute that stores a float value.

[`NSInteger16AttributeType`](/documentation/CoreData/NSAttributeType/integer16AttributeType)

An attribute that stores a 16-bit signed integer value.

[`NSInteger32AttributeType`](/documentation/CoreData/NSAttributeType/integer32AttributeType)

An attribute that stores a 32-bit signed integer value.

[`NSInteger64AttributeType`](/documentation/CoreData/NSAttributeType/integer64AttributeType)

An attribute that stores a 64-bit signed integer value.

[`NSObjectIDAttributeType`](/documentation/CoreData/NSAttributeType/objectIDAttributeType)

An attribute that stores a managed object’s ID.

[`NSStringAttributeType`](/documentation/CoreData/NSAttributeType/stringAttributeType)

An attribute that stores a string.

[`NSTransformableAttributeType`](/documentation/CoreData/NSAttributeType/transformableAttributeType)

An attribute that uses a value transformer to derive its value.

[`NSUndefinedAttributeType`](/documentation/CoreData/NSAttributeType/undefinedAttributeType)

An attribute that doesn’t have an explicit type.

[`NSURIAttributeType`](/documentation/CoreData/NSAttributeType/URIAttributeType)

An attribute that stores a uniform resource identifier.

[`NSUUIDAttributeType`](/documentation/CoreData/NSAttributeType/UUIDAttributeType)

An attribute that stores a universally unique identifier.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)