jsonr
The fastest, cleanest JSON formatter online. Paste raw JSON, get formatted output instantly. No sign-up, no server, no fuss. Your data never leaves your browser.
Paste this minified Stripe webhook payload into the input pane:
{"id":"evt_1Q8xK2","object":"event","api_version":"2024-06-20","created":1717689600,"data":{"object":{"id":"ch_3Q8xK2","amount":2499,"currency":"usd","status":"succeeded",}},"type":"charge.succeeded"}That trailing comma after "succeeded" is the kind of thing a logger or a hand-edit drops in, and strict JSON refuses it. The status pill flips to "nope" before you finish reading the blob, and the red error bar at the bottom reports the exact coordinates: Line 1, Column 121: Expected double-quoted property name in JSON at position 120.
From minified payload to readable JSON
Press Prettify and the same payload comes back as 14 lines of indented output:
{
"id": "evt_1Q8xK2",
"object": "event",
"api_version": "2024-06-20",
"created": 1717689600,
"data": {
"object": {
"id": "ch_3Q8xK2",
"amount": 2499,
"currency": "usd",
"status": "succeeded"
}
},
"type": "charge.succeeded"
}The output pane syntax-colors keys, strings, numbers, booleans, and null on different scales. That matters because most people paste into a formatter for one reason: they can't eyeball a 600-character wall of text fast enough to find the field they care about. The indent toggle between 2 and 4 spaces sits next to the Prettify button. Our default of 2 matches what Stripe, GitHub, and most CI configs ship with in their examples; 4 is there for teams whose linter wants it.
We tested auto-format on paste against a 1.2 MB GeoJSON file from a municipal open-data portal and the round trip ran in under 90 ms on a 2021 M1 Air. That's the only reason auto-format is on by default. Slower hardware on larger blobs changes the math, but we haven't seen a real payload that takes long enough to notice.
The output pane runs JSON.parse() on the input and re-renders with JSON.stringify(value, null, 2), so what the formatter shows is the value the parser saw. Numbers keep their original precision because the standard library does the round trip in IEEE-754 double, the same representation every other JSON consumer in your stack uses.
How the error bar earns its line number
When JSON.parse() fails, it throws a SyntaxError with a position field but no line or column. The browser knows the byte offset; nothing in the spec requires it to translate that into the row and column a human reads. jsonr does the translation itself: we walk the original input string up to the failing byte offset, counting newlines for the line number and the distance from the most recent newline for the column. The error bar shows both, plus the parser's own message ("Expected double-quoted property name").
We picked this over building a tolerant parser like jsonc-parser because the failure mode we kept hitting was that tolerant parsers happily swallow real bugs. A trailing comma in a config file you control is a typo. A trailing comma in a webhook payload from an upstream system is a signal something's wrong on their end, and you want to see it loudly. ECMA-404 and RFC 8259 section 5 are both explicit that JSON doesn't permit trailing commas, so neither do we.
Trailing commas, single quotes, and other reasons your paste fails
Single quotes around keys or string values fail for the same reason as trailing commas: RFC 8259 section 7 mandates double quotes. If you pasted a JavaScript object literal expecting it to format, the error bar lands on the first single quote. Switch every ' to " and the result lights up green.
Unquoted keys fail with the same parser error but a different column. {name: "Ada"} is JavaScript shorthand, not JSON; the parser stops at the n because it wanted a ". Wrap the key in double quotes.
JSONL or NDJSON files don't parse as a single document, because each line is its own JSON value with no surrounding array. Upload a .jsonl file and Prettify reports a parse error somewhere on line 2, where it hits the second top-level value. To format a batch, wrap the lines in [ ... ] with commas between them, then Prettify.
NaN, Infinity, undefined, and comments are all valid in JavaScript and invalid in JSON. The parser rejects them on sight.
Squish mode: what minification actually removes
Press Squish and the formatted output collapses back to a single line. Minification is doing one thing: removing whitespace between tokens. It isn't re-encoding strings, isn't normalizing number representations (so 1.0 stays 1.0 and doesn't become 1), isn't sorting keys, and isn't stripping null fields. The minified output is byte-for-byte the same as JSON.stringify(JSON.parse(input)) in your browser console. We use the standard library on the way out for exactly that reason.
The size difference is the point. The 14-line Stripe payload above expands from 167 bytes minified to 287 bytes prettified, a 72% bump from indentation and newlines alone. For URL query strings, log-line embeds, or anywhere you pay per byte, the round trip through Squish gets you back to the wire format without touching values.
One thing minify won't do: it can't fix invalid input. If your paste has a trailing comma, Squish reports the same line and column error as Prettify, because both modes have to parse first.
Frequently Asked Questions
How do I format JSON online?
How do I prettify JSON?
Is there a JSON formatter without ads?
Is there a JSON formatter that runs entirely in the browser?
Is there a dark mode JSON formatter?
Is jsonr safe for sensitive data?
Does jsonr work offline?
How do I minify JSON?
Why is my JSON invalid?
How do I copy formatted JSON to my clipboard?
What is the difference between prettify and minify?
How do I validate and format JSON at the same time?
Your JSON never leaves your browser. Everything runs locally via JSON.parse() + JSON.stringify(). No accounts, no tracking, no server calls.
See our Privacy Policy for details.