JSON Formatter & Validator
What this tool does
Paste JSON and it tells you two things straight away: whether it is valid, and if not, exactly where the problem is. Valid JSON is re-printed with proper indentation so nesting is readable, and can be minified back to a single line when you need to send it.
The errors people hit most
- Trailing comma —
[1, 2, 3,]is valid JavaScript but not valid JSON. - Single quotes — JSON strings and keys must use double quotes.
- Unquoted keys —
{name: "x"}must be{"name": "x"}. - Comments — JSON has none; strip
//and/* */first. - NaN or Infinity — not valid JSON values, however sensible they look.
Share this tool with friends
Free to use, no sign-up, works on any phone.
Frequently Asked Questions
No. Parsing and formatting are done by your browser's own JSON engine, so the data never leaves your device. That matters when the JSON is an API response containing customer records or keys.
The usual causes are a trailing comma after the last item, single quotes instead of double quotes, or an unquoted key. The error message here gives the line and column so you can go straight to it.
A few megabytes is comfortable. Beyond that the browser has to hold the text, the parsed object and the formatted output at once, so a very large file may become slow on a phone.
It rewrites every object with its keys in alphabetical order, all the way down. It is useful for comparing two responses that contain the same data in a different order.
No. Only the whitespace changes. Numbers, strings and structure are preserved exactly, with one caveat: JSON has no integer type, so a number beyond about 9 quadrillion loses precision — that is JavaScript, not this tool.