How to minify JSON
- Paste JSON into the editor or open a file.
- Click Minify. Spaces, tabs and line breaks between values are removed; spaces inside strings are kept.
- Copy the result. Click Format to make it readable again at any time.
How much smaller does it get?
Pretty-printed JSON with 2-space indentation is typically 20–40% larger than its minified form, and more for deeply nested data. For example:
{
"id": 42,
"tags": [
"new",
"sale"
]
} becomes {"id":42,"tags":["new","sale"]}.
When to minify
- API payloads and responses: less data to send, especially on mobile networks.
- Embedding JSON in an environment variable, a query string, a single log line or a database column.
- Fixtures and config files bundled into an app.
If your server already compresses responses with gzip or Brotli, minifying saves less, because compression removes most repeated whitespace too. It still helps with memory and parsing speed.
Safe and exact
Minifying never changes values: strings, key order and long numbers stay exactly as they were. If the JSON has a syntax error, you're told where it is, and Repair can fix common mistakes first. Everything runs in your browser.
Frequently asked questions
Does minifying JSON change the data?
No. Only whitespace between tokens is removed. Strings, numbers, key order and nesting are unchanged, so parsing the minified JSON gives exactly the same data.
How do I un-minify JSON?
Click Format. The minified JSON is re-indented with 2 spaces, 4 spaces or tabs, whichever you choose.
Is minifying the same as compressing?
Not quite. Minifying removes formatting characters, while compression (gzip, Brotli, zip) encodes the data more efficiently. They work well together.
Can I minify invalid JSON?
Invalid JSON is reported with its line and column first. Use Repair to fix common problems, then minify.
Is my JSON uploaded?
No. Minifying runs in your browser.