JSON Formatter & Validator NZ
This tool formats, minifies and validates JSON, helping you turn a tangled string of data into something readable, or compress clean JSON down for transport. JSON, short for JavaScript Object Notation, is the lingua franca of data exchange on the web: APIs return it, configuration files are written in it, and applications pass it back and forth constantly. It is designed to be both human and machine readable, but in practice JSON often arrives as one long unbroken line, or riddled with a misplaced comma or bracket that stops it parsing. This formatter fixes both problems. Paste your JSON in, choose to beautify it, and the tool re-indents everything into a clean, nested structure with consistent spacing, so you can actually read and navigate it. Choose minify instead and it strips out all the unnecessary whitespace to produce the most compact valid form, ideal for sending over a network or embedding in code. Either way, it validates as it goes: if the JSON is well formed, you get the formatted result; if not, it tells you that the input is invalid so you know to hunt for the stray comma, missing quote or unbalanced bracket. Everything runs in your browser, so even sensitive payloads stay on your device and are never uploaded. Use it to inspect an API response, to tidy a config file, to debug why a parser is rejecting your data, or to shrink JSON before pasting it somewhere. A reminder on the rules: JSON needs double quotes around keys and strings, no trailing commas, and no comments, which catches many people out.
Validates as it formats. JSON requires double quotes, no trailing commas and no comments. Runs entirely in your browser; nothing is uploaded.
How it works
The tool parses your text as JSON. If it parses cleanly, it is valid, and the tool re-serialises it: beautify mode adds line breaks and indentation of two or four spaces, while minify mode removes all optional whitespace for the most compact form. If parsing fails, the input is reported as invalid so you can find the syntax error.
Worked example
Pasting the compact object with a site name, a tool count, a flag and a list, then choosing beautify with two spaces, lays each property on its own indented line so the structure is clear. Switching to minify collapses it back to a single line with no spaces, the smallest valid form for sending over a network.
Related calculators
- Base64 Encoder: encode and decode text.
- Regex Tester: test regular expressions.
- HTML Entity Encoder: encode HTML.
- Text Case Converter: change text case.