<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSKeyedArchiver/encodedData",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSKeyedArchiver(py)encodedData"
  },
  "title" : "encodedData"
}
-->

# encodedData

The encoded data for the archiver.

```
var encodedData: Data { get }
```

## Discussion

If encoding has not yet finished, invoking this property calls [`finishEncoding()`](/documentation/Foundation/NSKeyedArchiver/finishEncoding()) and populates this property with the encoded data. If you initialized the keyed archiver with [`init(forWritingWith:)`](/documentation/Foundation/NSKeyedArchiver/init(forWritingWith:)) and a specific mutable data instance, this property contains that instance.

---

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)