JSON Formatter
Pretty-print and validate JSON, with the exact line and column of any error.
Compress JSON to a single line and see exactly how much you saved.
JSON Minifier removes every byte of whitespace that a machine does not need: the indentation, the line breaks and the spaces after colons and commas. The data itself is untouched, so the minified version parses to exactly the same structure as the original. What changes is the size, which matters when the JSON travels over a network or gets embedded in a page.
The tool validates before it minifies. If the input is not valid JSON you get an error with the line and column rather than a silently broken result, so you can never ship a mangled payload by accident.
After minifying you get three figures: the original size in bytes, the minified size, and the percentage saved. Heavily indented files routinely shrink by twenty to forty percent, which is a meaningful saving for an API response served thousands of times a day.
The json minifier is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
No. Only whitespace between tokens is removed. Spaces inside string values are preserved, so the parsed result is identical to the original in every respect.
It depends on how deeply nested and heavily indented the original is. Files formatted with four-space indentation commonly shrink by a quarter to a third; files that were already compact barely change.
Yes. Paste the minified JSON into the JSON Formatter to get a readable indented version back. No information is lost during minification.
If this tool accepted it, the JSON itself is valid. A failure downstream usually means the receiving system expects a particular schema, a specific encoding, or a wrapper such as JSONP rather than plain JSON.
Bytes, measured as UTF-8. Characters outside the ASCII range take more than one byte each, which is why a file with accented text or emoji is larger than its character count suggests.
It transfers faster because there is less of it. Parsing speed is roughly the same. If the response is also served with gzip or brotli compression, the extra saving from minifying is smaller but still real.
If the json minifier is not quite what you need, these other free tools solve closely related problems.
Pretty-print and validate JSON, with the exact line and column of any error.
Encode any text, including emoji and accents, to a Base64 string.
Escape spaces, symbols and non-ASCII characters for use in URLs.
Escape angle brackets and quotes to HTML entities, or decode them back.
Translate between Unix time and human-readable dates in both directions.