Developer
JSON Formatter and Validator
Format, minify and validate JSON entirely in your browser.
Runs entirely in your browser. Nothing you paste is uploaded.
0 bytes
How to use it
- Paste your JSON into the box marked "Your JSON"Anything goes in — one long unbroken line from an API response, a config file, a log entry. It does not need to be tidy or even valid yet; making it readable is the tool's job. Nothing is sent anywhere as you type.
- Press Format to lay it out, or Minify to compress itFormat indents the document so you can read it, keeping your keys in their original order. Minify does the opposite, stripping every space and newline outside of strings to make the file as small as possible. Only whitespace changes either way — the data itself is untouched.
- Set the indentation you preferThe Indent dropdown offers two spaces, four spaces or a tab. Pick whichever your project uses, then press Format again; the choice applies to the next result rather than to the one already on screen.
- If it reports an error, look just before the position it namesThe message points at the character where the parser gave up, which is usually one token after the actual mistake. A missing comma, a trailing comma after the final item, or single quotes instead of double quotes are the three causes behind most of them.
- Copy or download the resultUse the buttons above the output to put the formatted JSON on your clipboard or save it as a file. The output box is also editable, so you can correct something and press Format again without starting over.
About this tool
A JSON formatter takes machine-generated JSON — usually one long unbroken line — and lays it out with consistent indentation so you can actually read it. It also tells you whether the JSON is valid at all, and where it stops being valid.
This tool runs entirely inside your browser. Your JSON is never uploaded, never logged and never leaves your device, which matters when the payload you are debugging contains an API response with real customer data in it.
Understanding the result
Valid JSON is re-printed with two-space indentation and your keys in their original order.
Invalid JSON reports the character position where parsing failed. That position is where the parser gave up, which is often just after the real mistake — a missing comma or an unclosed bracket usually shows up one token earlier.
Minifying strips every space and newline that is not inside a string. The result is identical data in fewer bytes.
Example
Input
{"name":"Roftr","tools":[{"id":"DEV-01","active":true}],"count":1}Output
{
"name": "Roftr",
"tools": [
{
"id": "DEV-01",
"active": true
}
],
"count": 1
}Limitations
- Very large documents are limited by your browser's memory rather than by us. Several megabytes is usually fine; a hundred is not.
- JSON has no comments and no trailing commas. Files that use them — tsconfig.json, for instance — are technically JSONC and will be reported as invalid.
- Numbers are handled with JavaScript's number type, so integers beyond about 9 quadrillion lose precision when reformatted. This affects very large IDs.
- Key order is preserved as written, and duplicate keys collapse to the last occurrence, which is what the JSON specification permits.
Questions
Is my JSON sent to your server?
No. Formatting, validating and minifying all happen in your browser using its built-in JSON parser. Nothing is transmitted, so there is nothing for us to store or log.
Why does it say my JSON is invalid when it looks fine?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes around keys or strings, or an unquoted key. All three are valid JavaScript but not valid JSON.
Can I use this on confidential data?
The data never leaves your device, so the tool itself adds no exposure. Your own organisation's policy on where you paste confidential data still applies.
Does formatting change my data?
No. Only whitespace changes. The keys, values, types and ordering are identical — you can minify the formatted output and get your original bytes back.
Last updated 2026-08-16.