---
title: JSONEncoder.OutputFormatting
framework: foundation
role: symbol
role_heading: Structure
path: foundation/jsonencoder/outputformatting-swift.struct
---

# JSONEncoder.OutputFormatting

The output formatting options that determine the readability, size, and element order of an encoded JSON object.

## Declaration

```swift
struct OutputFormatting
```

## Topics

### Formatting Output

- [prettyPrinted](foundation/jsonencoder/outputformatting-swift.struct/prettyprinted.md)
- [sortedKeys](foundation/jsonencoder/outputformatting-swift.struct/sortedkeys.md)
- [withoutEscapingSlashes](foundation/jsonencoder/outputformatting-swift.struct/withoutescapingslashes.md)

### Creating Options

- [init(rawValue:)](foundation/jsonencoder/outputformatting-swift.struct/init(rawvalue:).md)
- [rawValue](foundation/jsonencoder/outputformatting-swift.struct/rawvalue.md)
- [init()](foundation/jsonencoder/init().md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [ExpressibleByArrayLiteral](swift/expressiblebyarrayliteral.md)
- [OptionSet](swift/optionset.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SetAlgebra](swift/setalgebra.md)

## See Also

### Customizing Encoding

- [outputFormatting](foundation/jsonencoder/outputformatting-swift.property.md)
- [keyEncodingStrategy](foundation/jsonencoder/keyencodingstrategy-swift.property.md)
- [JSONEncoder.KeyEncodingStrategy](foundation/jsonencoder/keyencodingstrategy-swift.enum.md)
- [userInfo](foundation/jsonencoder/userinfo.md)
