How to format and validate JSON
- Paste your JSON into the left box, or load the sample.
- The result appears instantly. Pick Format for readable output or Minify for the smallest size.
- If the JSON is invalid, the exact line and column of the problem are shown with the surrounding code.
- Turn on Tree view to fold and explore large documents.
Common JSON errors
- Trailing comma:
{"a": 1,}must be{"a": 1}. - Single quotes: strings and keys need double quotes, as in
"name". - Unquoted keys:
{name: 1}must be{"name": 1}. - Comments:
//and/* */are not part of JSON. - Special values:
undefined,NaNandInfinityare not valid; usenull.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser, so the JSON you paste never leaves your device.
Why is my JSON invalid?
The most common causes are trailing commas, single quotes instead of double quotes, unquoted property names, comments, and values like undefined or NaN. None of these are allowed in JSON, even though JavaScript accepts them.
Does formatting change my data?
No. Only whitespace changes, plus key order if you enable sorting. In Chrome, Edge and Firefox numbers are kept exactly as written, so large IDs like 12345678901234567890 are not rounded.
What does minify do?
Minifying removes all whitespace that is not inside strings, which makes the JSON as small as possible for sending over the network or storing.