Developer tools
JSON formatter & validator.
Paste JSON and it is beautified and checked as you type. Choose 2 spaces, 4 spaces or tabs, sort keys, minify, or open a collapsible tree. Errors show the line and column. Nothing leaves your browser.
Your JSON
Result
What counts as valid JSON
This page applies the grammar in RFC 8259, The JSON Data Interchange Format (December 2017), and ECMA-404, The JSON Data Interchange Syntax describes the same syntax: one value (object, array, string, number, true, false or null), double-quoted strings and property names, and only space, tab, line feed and carriage return as whitespace between tokens. A bare string or number is a valid JSON text; it does not have to be an object.
How to use the JSON formatter
Paste or type into the box. The result updates after a short pause: a green status means the document is valid, a red one points at the first problem with a caret under the exact character. Format re-indents with the indent you choose, Minify removes all optional whitespace, and the Tree tab shows the same document as collapsible nodes. Copy or download the result when you are happy with it.
Big numbers and duplicate keys are flagged, not changed
Most tools run JSON.parse and then JSON.stringify, which silently turns 9007199254740993 into 9007199254740992 and drops all but the last copy of a repeated key. This page keeps every number and string exactly as you wrote it. When a number has more precision than an IEEE 754 double can hold, as JavaScript numbers do, it gets a warning, because RFC 8259, The JSON Data Interchange Format (December 2017) (section 6) says software that expects no more than that precision interoperates best. Repeated property names get a warning with the line and column, because section 4 says names should be unique and that many parsers keep only the last one.
Common JSON errors and how to fix them
- Trailing comma after the last item, as in
[1, 2,]. The grammar only allows a comma between two values. Delete it. - Single quotes or unquoted property names. JSON needs
"name"in double quotes; JavaScript object literals are more relaxed than JSON. - Comments (
//or/* */). JSON has no comment syntax. - Leading zeros such as
007, a leading+, or a bare.5. Write7and0.5, or quote an ID that needs its zeros. NaN,Infinityandundefined. None is a JSON value; usenullor a string.- Raw line breaks inside a string. Write
\ninstead; control characters below U+0020 must be escaped.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Parsing, formatting and the tree all run in your browser tab. The text you paste is not sent to a server.
Why does my JSON work in my code but fail here?
Code often accepts more than JSON does: comments, trailing commas, single quotes and unquoted keys are fine in a JavaScript object literal or JSON5, but not in RFC 8259, The JSON Data Interchange Format (December 2017). This tool applies the strict standard, so the data will also be accepted by strict parsers in other languages.
Does formatting change my numbers or strings?
No. Numbers and strings are written back exactly as they were typed, including escapes such as \u00e9 and numbers longer than a JavaScript double can hold. Only whitespace between tokens changes, and key order when you tick Sort keys.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation so people can read it. Minifying removes all whitespace that the grammar treats as optional, so the same data takes fewer bytes.
Sources
RFC 8259, The JSON Data Interchange Format (December 2017); ECMA-404, The JSON Data Interchange Syntax; ECMAScript Language Specification (ECMA-262). All retrieved 2026-10. Parsing and formatting run entirely in your browser; this tool does not check your JSON against a schema or verify what the values mean.