JSON formatter and validator

Paste JSON to pretty-print it, minify it or check it is valid. Errors show the line and column. Your data stays in your browser.

What the JSON formatter does

Common JSON errors

ErrorFix
Trailing comma: [1, 2,]Remove the last comma
Single quotes: {'a': 1}Use double quotes: {"a": 1}
Unquoted keys: {a: 1}Quote every key
Comments: // noteJSON has no comments; remove them
undefined, NaNUse null or a number

Is it safe to paste private JSON?

Yes. Formatting and validation run in your browser with JavaScript's built-in parser. Nothing you paste is sent to a server.

Frequently asked questions

How do I format JSON?
Paste it into the input box. It is formatted as you type with 2-space indentation; you can switch to 4 spaces or tabs.
How do I find where my JSON is broken?
The status line shows the line and column of the first syntax error, along with the parser's message.
Does the formatter change my data?
The structure and values stay the same, with a few standard JavaScript limits: numbers are written in their shortest form (1.0 becomes 1, 1e2 becomes 100), integers beyond 2^53 such as 12345678901234567890 lose precision, if a key appears twice only the last value is kept, and escapes like \u00e9 are shown as the character. Sort keys changes the order of object keys.
Is there a size limit?
Only your browser's memory. Files of several megabytes format in well under a second on a modern computer.