Why values stay exact
The usual shortcut, JSON.stringify(JSON.parse(text)), converts every number to a JavaScript number and back. That rounds integers beyond 2^53 (12345678901234567890 becomes 12345678901234567000), drops trailing zeros (19.90 becomes 19.9) and rewrites escapes. This minifier works from the text instead, removing only the whitespace between tokens, so the output means exactly what the input did. Whitespace inside strings is kept.
How to use the JSON Minifier
- Paste JSON, or press Sample.
- Fix any error shown with its line and column.
- Copy or download the minified JSON, and check the bytes saved.
Examples
Numbers and escapes stay exact
{
"id": 12345678901234567890,
"price": 19.90,
"name": "Caf\u00e9 \"Central\"",
"tags": [ "coffee", "wifi" ],
"open": true,
"manager": null
}{"id":12345678901234567890,"price":19.90,"name":"Caf\u00e9 \"Central\"","tags":["coffee","wifi"],"open":true,"manager":null}152 bytes to 124. JSON.stringify would have printed the id as 12345678901234567000 and the price as 19.9.
Spaces inside strings are kept
{ "message": "Hello, world", "lines": [ "a b", " c " ] }{"message":"Hello, world","lines":["a b"," c "]}How much it saves
Indentation is often a third of a formatted JSON file. Over HTTP the difference mostly disappears once responses are compressed with gzip or Brotli, so minify when size matters uncompressed: storage, environment variables, URLs, logs, or embedding JSON in another file.
Common errors and how to fix them
Trailing comma
A comma after the last item is accepted by JavaScript but not by JSON. Remove it before minifying.
{ "items": [1, 2, 3,] }{ "items": [1, 2, 3] }The tool reports: Trailing commas are not allowed in JSON.
Limitations
- Input up to 10 MB.
- Strict JSON only: comments and trailing commas are reported as errors, not removed.
- Duplicate keys are kept as they are.
Frequently asked questions
Does minifying change my data?
No. Only whitespace between values is removed; every string, number and escape is copied exactly.
Can I minify JSON with comments?
Not here: comments aren't valid JSON, so they're reported as errors. Remove them first, or use the JSON Fixer, which converts JSON5 and similar input to valid JSON.
How do I make minified JSON readable again?
Paste it into the JSON Formatter, which indents it again without changing any value.
Is my JSON uploaded?
No. Minifying runs in your browser; your JSON is never sent anywhere or logged.