JSON Minifier
Compress JSON to its smallest valid form by removing all whitespace, using the native JSON parser.
- 1Paste your JSON
- 2Click Convert
- 3Copy the minified single-line output
What it does
The tool parses your JSON with the browser's built-in parser and writes it back out with no spaces or line breaks. Invalid input shows the parser's error message rather than output, which makes the tool a quick validity check as well.
Example
A pretty-printed object with indentation and newlines becomes a single line such as {"name":"Ana","tags":["a","b"]}. The data is identical; only whitespace is removed, which usually cuts size noticeably for deeply indented files.
Behaviours to be aware of
- Strict JSON only. Comments, trailing commas and single-quoted strings are rejected.
- Large integers lose precision. Numbers beyond 9,007,199,254,740,991 are rounded because JavaScript stores numbers as floating point. If you handle 64-bit IDs, keep them as strings.
- Duplicate keys collapse to the last value.
- Key order follows JavaScript object rules, so keys that look like whole numbers (
"2","10") are placed first in ascending order.
To make it readable again, use the JSON formatter.
Related Tools
JSON Formatter
Pretty-print JSON with real 2-space indentation using the browser's native JSON parser — shows the exact parse error if your JSON is invalid.
XML Formatter
Reformat XML with proper nested indentation based on tag depth — a lightweight tag-based indenter, not a full XML parser.
HTML Formatter
Reformat HTML with proper nested indentation based on tag depth — a lightweight tag-based indenter, not a full HTML parser.