JSON Formatter & Validator
Paste JSON to format it, find errors with the exact line and column, or minify it. Works offline once the page has loaded.
Runs in your browser. Nothing you type is uploaded.
How to use the JSON formatter
- Paste your JSON into the Input box.
- Click Format to make it readable, or Minify to make it small.
- If the JSON is invalid, the error message shows the line and column of the problem.
- Click Copy result to copy the output.
Common JSON errors
- Trailing comma:
{"a": 1,}— remove the comma after the last item. - Single quotes:
{'a': 1}— JSON needs double quotes around keys and strings. - Comments: JSON does not allow
//or/* */comments. - Unquoted keys:
{a: 1}— keys must be in double quotes.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting and validation happen in your browser with JavaScript. Nothing you paste leaves your device, so it is safe to use with private data.
Why does it say "Unexpected token"?
JSON is strict. The most common causes are a trailing comma after the last item, single quotes instead of double quotes, comments, or a missing comma between two items. The error shows the line and column so you can find it fast.
What is the difference between format and minify?
Format adds line breaks and indentation so people can read it. Minify removes all extra spaces so the file is as small as possible for sending over a network.