JSON Formatter and Validator
Max 512 KB · Formats automatically as you type
What is a JSON formatter?
JSON is easy for a program to write and hard for a person to read once the whitespace is gone — a config export, an API response, or a database dump often arrives as a single unbroken line. A JSON formatter reverses that: it takes raw or minified JSON text and re-indents it into a readable, nested structure, one key per line. Because it has to fully parse the text to reformat it, it validates as a side effect — a syntax error surfaces immediately, with the line number where parsing failed, rather than as a silent, hard-to-spot bug three steps later in whatever tool consumes the JSON.
How it works
Paste JSON into the input field on the left; the formatted result appears on the right as you type, debounced slightly so it doesn’t reformat on every keystroke. Parsing uses the browser’s built-in JSON.parse, and the output is produced with JSON.stringify at 2-space indentation. Switch to Minify mode to run the same parse step but serialize back out with no whitespace at all — useful when you need the smallest possible payload rather than the most readable one.
If JSON.parse throws, the tool shows the error message the browser produced along with the offending line number, instead of a blank or partially-rendered output. Nothing about this process touches a server: the 512 KB input cap exists only because very large documents get slow to re-parse on every keystroke in a browser tab, not because of any transmission limit. Use the Download button to save the formatted or minified result as a .json file.
Examples
- Debugging an API response — paste a minified response body from your browser's network tab to see its structure indented and readable.
- Cleaning up a config file pasted from Slack — a teammate pastes a one-line JSON blob in chat; format it before saving it back into a .json file.
- Minifying a JSON payload before embedding it in a script tag or a URL query parameter, where whitespace only adds dead weight.