JSON minify
Strips the whitespace and newlines out of JSON, compressing it onto one line to save transfer size.
Minify and compress your JSON by removing unnecessary whitespace.
Steps and notes
What is JSON minify?
Minifying JSON strips everything the machine does not need: indentation, padding spaces and newlines. The parsed value stays exactly the same, but the file gets smaller and fits on one line — useful for embedding a payload in an environment variable, a query parameter or a commit. The input side is more forgiving than the output side: parsing goes through JSON5, so comments, trailing commas, single quotes and unquoted keys are all accepted on the way in, and what comes out is strict, compact JSON. If the input cannot be parsed at all, the result is empty rather than a stack of error text.
- Paste the formatted JSON
- Get the minified result
- Copy and use it
- Input is parsed as JSON5, so comments and trailing commas survive — but they are gone in the output, because JSON has nowhere to put them.
- Key order is preserved as written; minification does not sort keys.
- Unparsable input yields an empty result, so an empty output means the input was invalid, not that it was already minimal.
Frequently asked questions
- How much smaller does the file get?
- For formatted JSON typically 20-40%: whitespace is pure overhead. Minifying does not shorten keys or values the way a binary format would — for transfer size, gzip on the transport layer is the next step.
- Is minified JSON still valid?
- Yes. Whitespace between tokens is not part of the JSON data model. Minifying requires parsing first, so invalid input errors out instead of producing broken output.
- How do I get it back into readable form?
- Paste it into the JSON formatter and it is re-indented. Minify and format are inverse operations at the presentation level — the data itself never changes.
- Does it also prettify, or only minify?
- Only minify — the output is deliberately one line with no indentation. For the readable form there is a separate JSON formatter; keeping the two directions in separate tools makes each one's output predictable.
- My file had comments in it — where did they go?
- They were accepted on input (JSON5 allows them) and dropped on output, because standard JSON has no comment syntax. If the comments are load-bearing, keep the annotated copy as the source of truth and minify only when shipping.
Category: Development
JSON tools workflow
JSON Formatter & Validator — Beautify, Validate, Diff and Convert → JSON minify → JSON diff → JSON to CSV → CSV to JSON → JSON to model classes → JSON to GET params