How to minify JSON
- Paste or drop your JSON. Minify is already selected.
- The one-line version appears on the right, with its size in bytes.
- Copy it, or Download a
.min.jsonfile.
When to minify
- Environment variables and CI secrets that must be a single line.
- API requests and webhooks, where every byte is sent.
- Static files on a website: smaller downloads (your server's gzip helps too).
Back to readable
Switch Indent to 2 or 4 spaces to turn minified JSON back into a readable version — or open the JSON Formatter. Comments in config files? Tick Allow comments and trailing commas and they are removed while minifying.
Private by design
The JSON never leaves your browser. Paste API responses with tokens or customer data without sending them to a server.
Troubleshooting
- The result is not valid JSON in my shell: wrap it in single quotes on Linux and Mac (
'…'); on Windows CMD escape the double quotes. - An error instead of a result: the input isn't valid JSON yet. The message shows the line and column — fix it, and the minified version appears.
- Unicode looks escaped: it isn't — text inside strings is kept exactly as you pasted it, including escapes that were already there.
Minify vs compress
Minifying removes whitespace, typically 20–40% of a formatted file. Web servers usually gzip or Brotli-compress JSON on top of that, which shrinks it much further — so for API responses minifying matters most for single-line needs, like environment variables, and for storage. Need to read it again later? Format it back in one click.
Frequently asked questions
Does minifying change my data?
No. Only spaces and line breaks between values are removed; text inside strings is untouched.
How much smaller does it get?
Typically 20–40% for formatted JSON; the status line shows the exact size.
Can I un-minify JSON?
Yes. Choose 2 or 4 spaces under Indent.
Is my JSON uploaded?
No.
Can I minify JSON with comments?
Yes. Tick Allow comments and trailing commas; comments are dropped.
Does minifying sort the keys?
No, the order stays the same unless you tick Sort keys.