Understand JSON format versions
What JSON versions exist, how the RFC and ECMA specifications differ, how supersets like JSON5 and JSONC fit in, and when formatting changes meaning.
People searching for a JSON version usually want to know whether there is a "JSON 2.0", which rules their parser follows, and whether a formatter, validator or converter will keep their data intact. This review covers the published specifications, the look-alike formats that are often mistaken for newer JSON versions, and what a transformation changes in practice.
Short answer: JSON has no version number
A JSON document carries no version field, and the grammar has not gained new syntax since it was first standardized. What has changed over time is how the specifications describe that grammar, which top-level values are permitted, and the rules around character encoding and interoperability. In practice, "which JSON version" usually means one of two things: which specification a tool claims to follow, or whether a file is strict JSON or a superset such as JSON5 or JSONC.
The specifications and how they differ
- RFC 4627 (2006): the first IETF description. A complete JSON text had to be an object or an array at the top level. Encoding could be UTF-8, UTF-16 or UTF-32, with UTF-8 as the default.
- RFC 7159 (2014): replaced RFC 4627. It allowed any JSON value at the top level, including a bare string, number, true, false or null. It also added interoperability guidance, for example that object member names should be unique and that number precision beyond common floating-point limits may not be portable.
- ECMA-404 (first edition 2013, second edition 2017): defines the syntax only. It deliberately says nothing about semantics such as duplicate keys, number precision or how values map to programming-language types.
- RFC 8259 (2017): the current IETF standard, aligned with the second edition of ECMA-404. It requires UTF-8 for JSON exchanged between systems that are not part of a closed ecosystem. It says implementations must not add a byte order mark, though parsers may ignore one. The grammar itself matches RFC 7159.
The practical difference between versions comes down to these edge cases. A strict RFC 4627 parser can reject a document that a current parser accepts. Lenient parsers may accept a byte order mark or a non-UTF-8 encoding that RFC 8259 discourages.
"hello"
42
null
Each line above is a valid complete JSON text under RFC 7159 and RFC 8259. Under RFC 4627 none of them is valid, because the top level was not an object or an array. Older libraries and some validators with a strict mode may still enforce that rule.
Formats often mistaken for newer JSON versions
- JSON5: a superset that adds comments, trailing commas, single-quoted strings, unquoted keys, hexadecimal numbers, and Infinity and NaN. It is not a newer version of JSON. A standard JSON parser will reject most JSON5 files.
- JSONC (JSON with comments): an informal convention used by some editors and configuration systems. Support for trailing commas varies by tool.
- JSON Lines (also called newline-delimited JSON): one complete JSON value per line. Each line is strict JSON, but the file as a whole is not a single JSON text.
- I-JSON (RFC 7493): a restricted profile of JSON rather than an extension. It forbids duplicate keys, requires UTF-8 and limits numbers to values that IEEE 754 double precision can represent exactly. It targets protocols that need predictable interoperability.
- JSON Schema drafts (such as draft-07 and 2020-12): these version a validation vocabulary written in JSON. They do not change JSON syntax. A validator's "draft" setting controls which schema keywords it understands, not which JSON it can parse.
// JSON5 input
{
name: 'example',
retries: 3,
}
// Equivalent strict JSON
{
"name": "example",
"retries": 3
}
Converting the JSON5 version to strict JSON drops the comment. Strict JSON has no place to keep it, so a round trip back to JSON5 will not restore it.
What a JSON transformation actually changes
Developer text tools perform several distinct operations, and they differ in whether the stored data changes.
- Pretty-printing and minifying change only whitespace between tokens. JSON treats space, tab, line feed and carriage return outside strings as insignificant, so the data stays the same. Whitespace inside string values is data and must not be touched.
- Key sorting reorders object members. The specifications treat objects as unordered, so the data model is unchanged. However, some applications, diffs and signatures depend on order, so sorting can still break things downstream.
- Escape normalization switches between a literal character and its \u escape, for example between é and \u00e9. Both decode to the same string. Characters outside the Basic Multilingual Plane, such as most emoji, escape as a surrogate pair of two \u sequences, and a correct tool treats the pair as one character.
- Superset-to-strict conversion, from JSON5 or JSONC to JSON, removes comments and rewrites syntax. Comments are lost.
- Re-serialization through a parser can change numbers. Large integers and long decimals may be rounded to the nearest double-precision value. Duplicate keys may collapse to one, and which one survives depends on the parser.
The terms "reverse", "mirror" and "font" from general text tools do not describe JSON operations. Reversing the characters of a JSON document produces invalid JSON. Reversing a single string value naively by code unit can split surrogate pairs, combining marks and multi-code-point emoji into broken sequences. Unicode "font" generators replace letters with different code points, such as mathematical alphanumeric symbols. A key restyled this way is a different key that no program will match to the original name. These changes alter the stored characters; they are not presentation.
Will the result stay valid after copying or sharing?
- Word processors, chat apps and some content systems can replace straight quotes with curly quotes, which makes the JSON invalid.
- Non-breaking spaces and other Unicode spaces pasted outside strings are not JSON whitespace, and strict parsers reject them.
- A byte order mark added by some editors on save can cause failures in parsers that follow RFC 8259 strictly.
- Trailing commas and comments from JSONC or JSON5 sources will fail in strict JSON contexts such as most API request bodies.
- Line-ending changes from LF to CRLF are harmless outside strings. Inside a string, a raw line break was never valid; it has to be written as \n.
Pretty-printed JSON is easier to scan, review in diffs and navigate by line. Minified JSON is a single long line that is hard to read in an editor and gives a screen reader no structural cues. No documentation or scoped tests were supplied for how specific screen readers, browsers' JSON viewers or code-hosting sites present JSON. Claims about particular assistive technologies or destinations would need to be checked in those environments. A JSON file is also not a substitute for a human-readable explanation. When the audience includes people who will not read raw data, provide a plain-text summary or a rendered table alongside it.
Is a given tool or format suitable for your use?
- Data exchanged between systems, such as APIs, webhooks and stored records: use strict JSON per RFC 8259, encoded as UTF-8 without a byte order mark. Avoid relying on key order, duplicate keys or integers beyond the range a double can hold exactly. Send very large numbers as strings if exactness matters.
- Human-edited configuration: JSON5 or JSONC is reasonable when every consuming tool supports it, since comments help maintenance. The tradeoff is that the file is no longer portable JSON.
- Logs and streaming: JSON Lines suits append-only output, but tools expecting one JSON document will not parse the whole file.
- Validation: choose a validator by the specification it documents for parsing, and separately by the JSON Schema draft it supports if you validate structure.
- Sharing with readers rather than programs: plain text or a formatted table is often better than raw JSON.
Pretty-printing, minifying and escape normalization preserve meaning when the tool parses and re-emits the data correctly. Key sorting, number handling, duplicate-key handling and superset conversion are where meaning can quietly change. Check those against your own data before trusting a tool's output.
Known gaps
No evidence was supplied about specific JSON tools. That includes which specification each one follows, how it treats duplicate keys or large numbers, whether it preserves key order, and whether it retains or transmits pasted data. Those behaviors vary and should be confirmed from each tool's documentation or by testing with representative input. Privacy and data-retention practices cannot be judged from a tool's interface or marketing.