Format, minify and validate JSON
Paste JSON and get it formatted instantly (2 or 4 spaces or tabs), minified or validated, with optional alphabetically sorted keys. On errors the tool shows line, column and a context snippet with a caret pointing at the exact spot. Everything runs in your browser: no upload, no signup, and it works offline.
Why should JSON never go into an uploading online formatter?
What developers paste into formatters is rarely harmless: API responses containing session tokens, config files with keys, exports full of customer data. Many web formatters transmit every input to their server, and you cannot see what happens to it there. This tool parses strictly locally with JSON.parse, the parser built into your browser. There simply is no server call anyone could intercept.
How does the tool find the error position?
Browsers report JSON errors differently depending on the engine: sometimes with a character position, sometimes with line and column, sometimes only with a text snippet. The tool understands all three formats, converts positions into line and column, and prints the affected line with a ^ pointer underneath. The most common causes: a comma after the last element (forbidden in JSON), single instead of double quotes, unquoted keys, or comments, which JSON does not have.
What counts as valid JSON?
The standard RFC 8259 (December 2017) defines JSON with exactly six structural characters ({ } [ ] : ,), four primitive types (string, number, boolean, null) and two structured types (object, array). Strings require double quotes, comments do not exist, and object keys are unordered by the standard. That is why sorting keys is lossless and useful, for example to diff two JSON documents line by line.
Format or minify, when to use which?
- Format for humans: code reviews, debugging, documentation. Two-space indentation is the most common style.
- Minify for machines: smallest transfer size for APIs, configs and storage. The content stays identical, only whitespace disappears.
Honest limits
Above roughly 1 MB of output the display switches to a plain textarea without syntax colors so the page stays responsive. Inputs above roughly 2 MB are not processed at all, so your browser tab cannot freeze. For giant files, use a command-line tool such as jq.