JSON Minifier
Minify JSON instantly — strip every space, tab and line break from a JSON document while keeping it valid and byte-for-byte equivalent. Paste JSON or drop a .json file; invalid JSON is reported with the exact parse error.
Input
Output
Guides
Squeeze every unnecessary byte out of a JSON document. The JSON Minifier removes the spaces, tabs and line breaks that make JSON readable but cost bandwidth — leaving a single compact line that is byte-for-byte equivalent to what you pasted in.
How to use it
- Paste your JSON into the input box, or drop a
.jsonfile onto the uploader. - The minified result appears instantly in the output panel.
- Copy it, or download it as
minified.json.
Because minifying is deterministic, there is nothing to configure — paste and go.
How much smaller does JSON get?
It depends on how it was indented. Pretty-printed JSON with 2-space indentation typically shrinks by 20–40%; deeply nested documents with 4-space indentation can lose more than half their size. The savings compound once the payload is also gzipped or Brotli-compressed over the wire.
Does minifying change the data?
No. The document is parsed and re-serialized, so keys, values, ordering, types and Unicode escapes all survive intact — only insignificant whitespace disappears. JSON has no comments to strip, so the output always parses back to exactly the same value. The one thing that will not survive is invalid JSON: trailing commas, single-quoted strings and comments are rejected rather than silently repaired.
What happens if my JSON is invalid?
You get the parser's error message — including the position of the offending character — instead of broken output. Fix the reported spot and the result updates as you type. If you want to inspect the structure first, run the document through the JSON Formatter to pretty-print and validate it, then come back here to compress it.
Is my JSON uploaded to a server?
No. Minification happens entirely in your browser using the built-in JSON parser. Your data never leaves your device, is never logged and is never stored — so API responses, config files, tokens and other sensitive payloads are safe to paste.
When should I minify JSON?
- API responses and request bodies — smaller payloads mean faster round-trips, especially on mobile networks.
- Config files shipped in a bundle — every byte counts in a JS bundle or a Docker image layer.
- Embedded JSON — inside HTML
<script type="application/json">blocks, JSON-LD structured data, or a database column. - Log lines — one-line JSON is the standard for structured logging, where a record must occupy exactly one line.
Can I minify a very large file?
Yes. Files are read and processed locally, so the only real limit is your browser's memory. Multi-megabyte documents minify in well under a second on a typical machine.