<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/PropertyListSerialization",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPropertyListSerialization"
  },
  "title" : "PropertyListSerialization"
}
-->

# PropertyListSerialization

An object that converts between a property list and one of several serialized representations.

```
class PropertyListSerialization
```

## Overview

The [`PropertyListSerialization`](/documentation/Foundation/PropertyListSerialization) class provides methods that convert a property list to and from several serialized formats. A property list is itself an array or dictionary that contains only [`NSData`](/documentation/Foundation/NSData), [`NSString`](/documentation/Foundation/NSString), [`NSArray`](/documentation/Foundation/NSArray), [`NSDictionary`](/documentation/Foundation/NSDictionary), [`NSDate`](/documentation/Foundation/NSDate), and [`NSNumber`](/documentation/Foundation/NSNumber) objects.

Property list objects are toll-free bridged with their respective Core Foundation types (<doc://com.apple.documentation/documentation/CoreFoundation/CFData>, <doc://com.apple.documentation/documentation/CoreFoundation/CFString>, and so on). See [Toll-Free Bridging](https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/Toll-FreeBridgin/Toll-FreeBridgin.html#//apple_ref/doc/uid/TP40010810-CH2)  for more information on toll-free bridging.

## Topics

### Serializing a Property List

[`data(fromPropertyList:format:options:)`](/documentation/Foundation/PropertyListSerialization/data(fromPropertyList:format:options:))

Returns an `NSData` object containing a given property list in a specified format.

[`writePropertyList(_:to:format:options:error:)`](/documentation/Foundation/PropertyListSerialization/writePropertyList(_:to:format:options:error:))

Writes a property list to the specified stream.

[`PropertyListSerialization.WriteOptions`](/documentation/Foundation/PropertyListSerialization/WriteOptions)

### Deserializing a Property List

[`propertyList(from:options:format:)`](/documentation/Foundation/PropertyListSerialization/propertyList(from:options:format:))

Creates and returns a property list from the specified data.

[`propertyList(with:options:format:)`](/documentation/Foundation/PropertyListSerialization/propertyList(with:options:format:))

Creates and returns a property list by reading from the specified stream.

### Validating a Property List

[`propertyList(_:isValidFor:)`](/documentation/Foundation/PropertyListSerialization/propertyList(_:isValidFor:))

Returns a Boolean value that indicates whether a given property list is valid for a given format.

### Obsolete Methods

[`dataFromPropertyList(_:format:errorDescription:)`](/documentation/Foundation/PropertyListSerialization/dataFromPropertyList(_:format:errorDescription:))

This method is obsolete and will be deprecated soon.

[`propertyListFromData(_:mutabilityOption:format:errorDescription:)`](/documentation/Foundation/PropertyListSerialization/propertyListFromData(_:mutabilityOption:format:errorDescription:))

This method is deprecated. Use [`data(fromPropertyList:format:options:)`](/documentation/Foundation/PropertyListSerialization/data(fromPropertyList:format:options:)) instead.

### Constants

[`PropertyListSerialization.MutabilityOptions`](/documentation/Foundation/PropertyListSerialization/MutabilityOptions)

These constants specify mutability options in property lists.

[`PropertyListSerialization.PropertyListFormat`](/documentation/Foundation/PropertyListSerialization/PropertyListFormat)

These constants are used to specify a property list serialization format.

[`PropertyListSerialization.ReadOptions`](/documentation/Foundation/PropertyListSerialization/ReadOptions)

The only read options supported are described in [`PropertyListSerialization.MutabilityOptions`](/documentation/Foundation/PropertyListSerialization/MutabilityOptions).

### Error Codes

[`NSPropertyListReadCorruptError`](/documentation/Foundation/NSPropertyListReadCorruptError-swift.var)

Parsing of the property list failed.

[`NSPropertyListReadUnknownVersionError`](/documentation/Foundation/NSPropertyListReadUnknownVersionError-swift.var)

The version number of the property list cannot be determined.

[`NSPropertyListReadStreamError`](/documentation/Foundation/NSPropertyListReadStreamError-swift.var)

Reading of the property list failed.

[`NSPropertyListWriteStreamError`](/documentation/Foundation/NSPropertyListWriteStreamError-swift.var)

Writing to the property list failed.

[`NSPropertyListWriteInvalidError`](/documentation/Foundation/NSPropertyListWriteInvalidError-swift.var)

Writing failed because of an invalid property list object, or an invalid property list type was specified.

[`NSPropertyListErrorMinimum`](/documentation/Foundation/NSPropertyListErrorMinimum-swift.var)

The start of the range of error codes reserved for property list errors.

[`NSPropertyListErrorMaximum`](/documentation/Foundation/NSPropertyListErrorMaximum-swift.var)

The end of the range of error codes reserved for property list errors.

[`NSPropertyListReadCorruptError`](/documentation/Foundation/NSPropertyListReadCorruptError-c.enum.case)

Parsing of the property list failed.

[`NSPropertyListReadUnknownVersionError`](/documentation/Foundation/NSPropertyListReadUnknownVersionError-c.enum.case)

The version number of the property list cannot be determined.

[`NSPropertyListReadStreamError`](/documentation/Foundation/NSPropertyListReadStreamError-c.enum.case)

Reading of the property list failed.

[`NSPropertyListWriteStreamError`](/documentation/Foundation/NSPropertyListWriteStreamError-c.enum.case)

Writing to the property list failed.

[`NSPropertyListWriteInvalidError`](/documentation/Foundation/NSPropertyListWriteInvalidError-c.enum.case)

Writing failed because of an invalid property list object, or an invalid property list type was specified.

[`NSPropertyListErrorMinimum`](/documentation/Foundation/NSPropertyListErrorMinimum-c.enum.case)

The start of the range of error codes reserved for property list errors.

[`NSPropertyListErrorMaximum`](/documentation/Foundation/NSPropertyListErrorMaximum-c.enum.case)

The end of the range of error codes reserved for property list errors.



---

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)