Format JSON
Turn one long line of JSON into something you can read, or squeeze it back down. Large numbers keep every digit, which most online formatters quietly get wrong. Nothing is stored.
- Never stored
- No queue, no waiting
- No signup, no watermark
The formatted JSON appears here.
How it works
Paste your JSON
Or drop a .json file in. Whatever you paste stays in this page — nothing is stored.
Pick an indent
Two spaces, four, tabs, or minified down to a single line. The choice is remembered for next time.
Copy or download
Copy the result, or save it as a file. If the JSON is broken you get the line, the column and the character instead.
What survives the round trip
Formatting is a parse and a re-print, and numbers are the only part carried through as the text you typed. That is wider than the big-integer case the banner counts: any number whose shortest JavaScript spelling differs from yours is re-emitted from its source, so 1.10 keeps its trailing zero, 1e5 stays in exponent form and a negative zero stays negative. Only unsafe whole numbers are counted in the warning, because those are the ones where the alternative is silent corruption rather than a tidied-up spelling.
Strings are not carried through as text. Escapes are decoded when the document is read and written fresh when it is printed, so \u0041 comes back as A and an escaped forward slash comes back bare. The value is identical and the bytes are not, which matters only in one situation and matters a lot there: if something downstream compares two JSON files byte for byte, running one of them through a formatter is not a no-op.
Two object-level behaviours are worth knowing before you trust a reformat. Duplicate keys are resolved silently, last one winning, exactly as the browser's own parser resolves them — a document carrying two "id" fields formats without complaint and comes back with one, and nothing tells you the other existed. And key order is your file's order only for keys that are not whole numbers: an object holding "1", "2" and "name" comes back with the digit keys first, in numeric order, because that is how JavaScript itself orders object properties. Ordinary keys keep the order you wrote them in.
When you want something else
If what you have is a tsconfig.json, an ESLint config or a VS Code settings file, this page will point at the comments and trailing commas rather than format around them, and that is the right answer for a JSON tool and the wrong tool for your file. Those are JSONC, and your editor already parses them; on the command line, json5 and dasel both read them without pretending they are JSON.
For anything beyond re-indenting, a formatter is the wrong shape of tool. jq does in one expression what a paste box has no control for: jq -S . sorts every object's keys so two responses can be compared, jq 'del(.token)' strips a field before you show a payload to anyone, and jq -c collapses an array of objects into the JSON Lines a pipeline wants. It also reads a file rather than a clipboard, which is the difference once the document is bigger than you can comfortably select.
Frequently asked questions
Is my JSON stored anywhere?
No. There is no server call and no logging, and nothing is stored. You can disconnect from the internet after the page loads and it keeps working. That matters here more than it looks: the things people paste into an online formatter are API responses, config files and error payloads, and those routinely carry tokens, customer records and internal hostnames.
Why does this keep large numbers exact when other formatters do not?
Because almost every other one silently breaks them. A JavaScript number is a 64-bit float, so it can only hold whole numbers up to 9,007,199,254,740,991 exactly. Anything larger — a Twitter/X post ID, a Discord snowflake, a bank account number, a 64-bit database key — loses its last digits the moment it passes through `JSON.parse`. The number still looks plausible, which is what makes it dangerous: 7205759403792793600 quietly becomes 7205759403792793000. This page keeps the digits you pasted, exactly, and tells you how many numbers it had to protect.
What does it do with a broken file?
It tells you where the problem is, not just that there is one. You get the line number, the column, the line itself with a caret under the offending character, and a description in plain words — "a trailing comma before }" rather than "Unexpected token". Trailing commas, single quotes, unquoted keys and unescaped newlines inside strings are the four that account for most broken JSON, and each is named specifically.
Does it handle JSON Lines / NDJSON?
Yes, and it keeps the shape. JSON Lines is one complete JSON value per line — the format logs and data exports use — and pretty-printing it across multiple lines would destroy the thing that makes it useful. It is detected automatically, each line is formatted on its own, and the one-value-per-line layout is preserved.
Can it fix JSON with comments or trailing commas?
It will point at them precisely, but it will not silently accept them. Comments and trailing commas are not JSON — they are JSON5 or JSONC, which is what config files like tsconfig.json actually use. A formatter that quietly accepted them would hand you a file that your parser then rejects, which is worse than an error here.
Is there a size limit?
Available memory, rather than a cap we impose. Documents of a few megabytes format instantly; very large ones are limited by how much can be held at once, not by anything on our side.
Does minifying change my data?
No. Minifying removes only whitespace between tokens — it never reorders keys, never changes number formatting, never drops anything. The result parses to exactly the same value, just smaller.
Good to know: Formatting is exact — the document is parsed and re-printed, so anything that parses will come back out. Strict JSON only: comments, trailing commas and unquoted keys are rejected rather than silently repaired, because repairing them would mean guessing. Very large documents are held in memory twice while formatting.
Put this tool on your website
Free for any blog, class page or help article. Paste one snippet and your visitors can use it right on your page.