JSON formatter and beautifier.
Paste minified or messy JSON and get it back indented and readable. Or go the other way and minify it. Nothing leaves your browser.
- Free
- No signup
- Runs in your browser
21 lines, 319 B. Strings and numbers are left exactly as you typed them.
How it works.
- 1
Paste your JSON, or open a .json file. A sample is already loaded so you can see the result.
- 2
Pick 2 spaces, 4 spaces, tabs or minify. Turn on key sorting if you want stable diffs.
- 3
Copy the result or download it as a .json file. It updates as you type.
Formatting changes whitespace, nothing else
Most online formatters run your text through JSON.parse and JSON.stringify. That rounds any integer above 9,007,199,254,740,991 and rewrites escapes like \u00e9. Long database IDs come back quietly changed.
This one reads the text itself and keeps every string and number exactly as you wrote it. Only indentation, line breaks and, if you ask, key order change.
When to sort keys, when to minify
Sorted keys make two versions of the same file line up in a git diff, so a review shows real changes instead of moved lines. Minified JSON is for the wire: API payloads, env vars that hold JSON, fixtures embedded in code.
If the input isn't valid JSON, you get the line, the column and the reason instead of an empty box.
Questions, answered.
How do I format JSON?
Paste it into the box on the left. The formatted version appears on the right straight away. Pick an indent size, then copy it or download it as a .json file.
Is a JSON formatter the same as a JSON beautifier?
Yes. Formatter, beautifier and pretty printer all mean the same thing: adding line breaks and indentation so people can read the data. Minifying is the reverse.
How do I pretty print JSON in JavaScript?
Use JSON.stringify(value, null, 2). The third argument is the indent: a number of spaces, or a string like a tab. It rounds integers larger than 2^53, which this tool doesn't.
Should JSON use 2 or 4 spaces?
2 spaces is the default in most JavaScript projects, in Prettier and in package.json. 4 spaces is common in Python projects. Tabs let each reader pick their own width. Match whatever your repo already uses.
Is my JSON sent to a server?
No. Formatting runs in your browser tab. Nothing is uploaded or logged, so it's fine to paste API responses with tokens or customer data in them.
More free tools.
All tools- JSON ValidatorFind the exact line and column of a JSON error, with a plain fix.
- JSON DiffCompare two JSON documents and list every change by path.
- JSON to TypeScriptGenerate TypeScript interfaces or types from a JSON sample.
- JSON to YAMLTurn JSON into clean YAML, quoted so every parser reads it the same.
Formatted JSON is nice. Typed JSON is better.
Add an endpoint that lists invoices and show them in the web app.. Add a settings page that saves to the API.. Let people sign in with Google.Hype Stack is a free starter where the API's types flow through to every app, so you rarely squint at raw JSON. Six apps, one API.