JSON
JSON Formatter
Minify and beautify JSON.
About JSON formatting
JSON (JavaScript Object Notation) is a text format for structured data. Minifying strips whitespace to shrink payloads for transport; beautifying re-indents it so humans can actually read nested objects and arrays.
JSON is stricter than it looks. Trailing commas, single-quoted strings, unquoted keys, and comments are all valid in a JavaScript object literal but are syntax errors in JSON — a common source of "why won't this parse" confusion when copying an object literal out of source code. Numbers are IEEE-754 doubles, the same as JavaScript's own number type, so integers larger than 2^53 (about 9 quadrillion) can silently lose precision once parsed — a real concern for values like 64-bit database IDs or Discord-style snowflake IDs.
Where you'll run into it
- Shrinking API responses or config files before shipping them
- Pretty-printing a minified response to debug it
- Cleaning up JSON pasted from logs or browser dev tools
- Inspecting a payload alongside a decoded JWT
Frequently asked
Why does minifying not change the data?
Minifying only removes insignificant whitespace between tokens — keys, values, and structure are untouched, so the parsed result is identical.
Will this fix invalid JSON?
No — it validates and reformats valid JSON. If your input has a syntax error, like a trailing comma, you'll get an error instead of a guess.
Does it preserve key order?
Yes. Object keys are kept in the order they appear in your input.
Why did my large ID number change slightly?
JSON numbers are parsed as IEEE-754 double-precision floats, which can only represent integers exactly up to 2^53 (9,007,199,254,740,991). A 64-bit ID beyond that range loses precision the moment it's parsed as a number. The usual fix is for the source system to send such IDs as JSON strings instead of bare numbers — this tool reformats whatever numeric precision it's given, it can't recover digits that were already lost upstream.