Paste JSON to check that it is valid and turn it into readable, indented text or a compact single line. Everything runs in your browser.
Paste your JSON and format or validate it
Formatting changes the whitespace, not the structure. Because the text is parsed by your browser's JSON engine, three details can differ from your input, and it is worth knowing them before you copy the result back:
"2" and "10", move to the start of their object in ascending order. Other keys keep their order.12345678901234567890 becomes 12345678901234567000. Store long IDs as strings to keep them exact.1.10 becomes 1.1 and 1e3 becomes 1000.JSON (JavaScript Object Notation) is a text format for structured data, defined by RFC 8259 and ECMA-404. It looks like JavaScript, but it is much stricter, and most validation errors come from habits that JavaScript allows and JSON does not:
{"name": "Ana"} is valid; {name: "Ana"} is not.'Ana' with single quotes is rejected.[1, 2, 3,] fails because of the comma before the closing bracket.// ... nor /* ... */ is part of JSON.true, false and null. undefined, NaN and Infinity are not.\n and a tab as \t.Indented JSON is easier to read, review and compare in version control, so it suits configuration files, documentation and debugging an API response. Compact JSON removes every unnecessary space and line break, which makes payloads smaller for storage and network transfer. Both forms contain exactly the same data.
The formatter runs entirely on your device. The JSON you paste is not uploaded to our servers, so you can safely format responses that contain internal data. See the privacy policy for details.
A JavaScript object literal can use unquoted keys, single quotes, trailing commas and comments. JSON allows none of these. Remove them and the input will validate.
It does not sort them, with one exception: keys that look like whole numbers are placed first, in numeric order, because that is how JavaScript engines store object keys. If the same key appears twice in one object, only the last value is kept.
There is no fixed limit. Because formatting happens in your browser, very large documents, typically tens of megabytes, depend on your device's memory and may take a moment.