<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/JSONSerialization/ReadingOptions/json5Allowed",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSJSONReadingOptions@NSJSONReadingJSON5Allowed"
  },
  "title" : "json5Allowed"
}
-->

# json5Allowed

Specifies that reading serialized JSON data supports the JSON5 syntax.

```
static var json5Allowed: JSONSerialization.ReadingOptions { get }
```

## Discussion

The JSON5 Data Interchange Format is a superset of JSON that enhances human-readability of the JSON syntax. The JSON5 standard allows the following:

- Single- or double-quoted strings.
- Strings that span multiple lines.
- Single- and multiline comments, using `//` and `/* … */` syntax.
- Enhanced number formatting support, including hexadecimal, leading or trailing decimal point, explicit plus sign, and IEEE 754 positive infinity, negative infinity, and `NaN`.

### Using JSON5 in Attributed Strings

The Markdown syntax supported by [`AttributedString`](/documentation/Foundation/AttributedString) uses JSON5 to support an extended attribute syntax. Automatic grammar agreement uses this syntax for its `inflect` attribute, as do custom attributes defined by third-party frameworks. Use the syntax `^[text](attribute: value)` to mark ranges of text decorated with a custom attribute, like this:

```other
This is a [Markdown](https://commonmark.org) string with a ^[custom attribute](factor: 10).
```

This example applies a custom attribute called `factor` with a value of `10` to the text “custom attribute” in the resulting attributed string. The portion inside the parentheses is JSON5. [`AttributedString`](/documentation/Foundation/AttributedString) also uses the [`topLevelDictionaryAssumed`](/documentation/Foundation/JSONSerialization/ReadingOptions/topLevelDictionaryAssumed) option; without it, the Markdown string would have to wrap everything inside the parentheses with braces.

---

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)