<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSData/Base64EncodingOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSDataBase64EncodingOptions"
  },
  "title" : "NSData.Base64EncodingOptions"
}
-->

# NSData.Base64EncodingOptions

Options for methods used to Base64 encode data.

```
struct Base64EncodingOptions
```

## Topics

### Initializers

[`init(rawValue:)`](/documentation/Foundation/NSData/Base64EncodingOptions/init(rawValue:))

### Constants

[`NSDataBase64Encoding64CharacterLineLength`](/documentation/Foundation/NSData/Base64EncodingOptions/lineLength64Characters)

Set the maximum line length to 64 characters, after which a line ending is inserted.

[`NSDataBase64Encoding76CharacterLineLength`](/documentation/Foundation/NSData/Base64EncodingOptions/lineLength76Characters)

Set the maximum line length to 76 characters, after which a line ending is inserted.

[`NSDataBase64EncodingEndLineWithCarriageReturn`](/documentation/Foundation/NSData/Base64EncodingOptions/endLineWithCarriageReturn)

When a maximum line length is set, specify that the line ending to insert should include a carriage return.

[`NSDataBase64EncodingEndLineWithLineFeed`](/documentation/Foundation/NSData/Base64EncodingOptions/endLineWithLineFeed)

When a maximum line length is set, specify that the line ending to insert should include a line feed.

## Relationships

### Conforms To

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

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

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

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

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

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

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

[`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)