JSON Formatter
Beautify JSON with 2-space indentation, right in your browser.
What is JSON Formatter
JSON formatting adds line breaks and indentation to minified JSON, making it readable. Useful for inspecting config files and API responses.
🔒 Everything runs in your browser. Nothing is uploaded.
What this tool actually does with your file
- Where it runs
- In your browser, on this page
- Upload
- None — the file never leaves your device
- Offline
- Works with the network disconnected
Parsing first, printing second
The input is passed through JSON.parse and re-serialised with two-space indentation. Because it is a real parse rather than a text reformatter, anything JSON does not allow is rejected with a position — trailing commas, comments, single-quoted strings, unquoted keys, and NaN all fail here even though JavaScript source accepts them.
The error message names a character offset, which is the practical way to find the problem: count to that offset in the original string. Most failures are a trailing comma before a closing brace, or a smart quote introduced by a word processor when the payload was copied out of a document.
What the round trip silently changes
Comments are gone, because JSON has no comments — if the source used JSONC or JSON5, they are not recoverable from the output. Duplicate keys collapse to the last occurrence. Key order is preserved for string keys, but integer-like keys are reordered first, since JavaScript objects treat them as array indices.
Numbers are the dangerous part. Anything beyond 2^53 loses precision: 12345678901234567890 comes back as 12345678901234567000. Snowflake IDs, Twitter/X IDs, database bigints and Ethereum wei values are all in that range, and the corruption is silent. If the payload carries large integers, treat them as strings at the source rather than reformatting them here.
Formatting is not validation
A document that parses is syntactically valid JSON, not correct data. Duplicate keys, wrong types, missing required fields and a number where a string was expected all pass. If you need schema checking, that is a separate step with a JSON Schema validator.
The practical limit is size: parsing builds the entire object in memory, so a multi-megabyte document is fine and a hundred-megabyte one will freeze the tab. For files that large, use a streaming formatter rather than a browser page.
How to use
- 1.Paste your JSON
- 2.Click Format
- 3.Copy the result
How this compares
There are three ways to do this conversion: in the browser (this page), through a server-side converter, or with a desktop app. The useful difference is not speed — it is where your file goes and how far the free tier actually reaches.
| Aspect | This tool | Upload-based converters | Desktop software |
|---|---|---|---|
| Where the file is processed | In your browser, on this page | On the vendor's servers, after an upload | On your own machine, after installing an app |
| Account required | No | Usually — free tiers ask you to sign in before lifting a limit | No, though a licence may be needed |
| Size you can process for free | No size cap, no run limit | A few files per hour, or a ~5–10 MB cap before a paywall | Whatever your disk and RAM allow |
| Price | Free. Pro is $9/month, and only buys larger files and AI features | Usually a subscription — roughly $7–15/month as of November 2026 | A one-off licence, or a subscription |
| Works offline | Yes, once the page has loaded | No | Yes |
| Time before work starts on a 20 MB file | Immediate — there is nothing to upload | Dominated by the upload — about 16 s on a 10 Mbps uplink | Just the app launch |
| What it cannot preserve | Invalid input returns the parser error position instead of a repaired file | The same — the conversion is the same maths | The same, though some desktop apps re-render styles more faithfully |
Server-side converters are genuinely better at some things: very large files, sharing results with a team, keeping a conversion history, and automating batches from a script. For the case in front of you — one file, one format change, right now — they mostly add an upload wait and a sign-up form.
Frequently asked questions
What is JSON formatting?
It adds line breaks and indentation to make JSON readable.
What about invalid JSON?
A syntax error message is shown if the JSON is malformed.
Is data uploaded?
No, everything runs in your browser.
What this kind of conversion cannot keep
Formatters parse the input into a tree and print it back with consistent indentation. If the input is invalid, you get the parser's error position instead of a silently mangled file — malformed JSON stays malformed rather than being «repaired» into something that is no longer yours.
More in Format
On this page
- What is JSON Formatter
- What it does with your file
- How it actually behaves
- How to use it
- How this compares
- FAQ
Excel formula reference
29 functions with syntax, arguments and a table you can retype.
Browse the list →