What this tool does
A JSON formatter re-prints JSON so its structure is visible: one key per line, nesting shown by indentation, and arrays broken apart. It is the fastest way to read an API response that arrived as one unbroken line, and the fastest way to find the missing comma that a parser is complaining about.
Minifying does the reverse. Because whitespace outside strings carries no meaning in JSON, removing it produces a byte-for-byte smaller payload that parses identically — useful for config you are pasting into an environment variable or a query string.
Common JSON errors, and what causes them
- Trailing comma after the final item in an object or array. Valid in JavaScript, invalid in JSON.
- Single quotes around keys or strings. JSON requires double quotes.
- Unquoted keys. { name: "x" } is a JavaScript object literal, not JSON.
- A raw newline or tab inside a string, which must be escaped as \n or \t.
- NaN, Infinity or undefined as values — none of the three exist in JSON.
More free text tools
- Word counterLive word count with reading time, sentences and paragraphs.
- Character counterCharacters with and without spaces, against X, SMS and SEO limits.
- Letter counterCount letters only, with a frequency breakdown for puzzles.
- Text cleanerStrip extra spaces, blank lines and invisible characters in one pass.
- Remove line breaksRejoin text that a PDF or email broke into short lines.
- Text compareDiff two versions and see what was added, removed and left alone.
Frequently asked questions
Is this JSON formatter free?
Yes, completely, with no account and no limit on how much JSON you paste.
Is my JSON uploaded anywhere?
No. Formatting runs entirely in your browser using the built-in JSON parser, so nothing is sent to a server. You can paste API responses containing keys or customer data without it leaving your machine.
Why does it say "unexpected token"?
That is the JavaScript parser reporting the first character it could not make sense of. The most common causes are a trailing comma after the last item, single quotes instead of double quotes around keys, or an unescaped newline inside a string. Where your browser reports a location, the line number is shown alongside the error.
What is the difference between formatting and minifying?
Formatting adds indentation and line breaks so a human can read the structure. Minifying strips every optional space so the payload is as small as possible, which is what you want before sending it over a network.
Does formatting change my data?
No. The JSON is parsed and re-serialised, so only whitespace changes. Key order is preserved. Note that duplicate keys are legal in JSON text but not in the parsed result — if your input has the same key twice, only the last one survives.