JSON Minify
Paste formatted JSON and get a compact, single-line version with all unnecessary whitespace removed.
Example
Input
{
"name": "CalcCafe",
"tools": ["json", "yaml"]
}Output
{"name":"CalcCafe","tools":["json","yaml"]}How it works
The minifier parses your JSON and re-serialises it with no spaces or line breaks, producing the smallest valid representation — ideal for reducing API payloads and storage size.
Good to know
JSON Minify takes formatted, indented JSON and collapses it into the smallest valid single-line equivalent by stripping every space, tab, and newline that sits between tokens. Because it actually parses the input before re-serialising it, a successful minify also doubles as a quick validity check — if the tool produces output, your JSON is structurally sound. It is built for backend and frontend developers, API authors, and anyone shipping JSON configs or fixtures who wants a lighter payload without altering a single value.
Reach for it when you are about to send JSON over the wire, embed it in a database column or environment variable, store it in localStorage, or paste it into a script where line breaks would be a nuisance. Minifying before gzip still helps a little, but the bigger wins are on uncompressed transfers, on storage that counts characters, and anywhere the pretty-printing was only ever there for human reading.
To read the result, remember that nothing about your data changes — only the cosmetic whitespace disappears. Keys, values, ordering, numeric precision, escaped characters, and Unicode all come through exactly as written; whitespace that lives inside a string (for example "hello world") is preserved because it is part of the value, not formatting. The shrinkage you see in size depends entirely on how heavily indented the original was.
- One practical caveat: minified JSON is much harder to scan or debug by eye, so keep an indented copy for editing and only minify the version you ship — or pair this with a JSON formatter/beautifier to reverse the process when you need to read it again.
Frequently asked questions
How much smaller will my JSON be?
It removes every space, tab and newline between tokens. For pretty-printed JSON that's often a 20–50% size reduction.
Is minified JSON still valid?
Yes — minifying only removes insignificant whitespace; the data and structure are identical.
Is my JSON uploaded anywhere?
No — everything runs in your browser with JavaScript. Your data never leaves your device, so it's safe for sensitive payloads and works offline once loaded.
Is this tool free?
Yes, completely free with no sign-up and no limits.
More JSON tools
People also ask
What is the difference between minifying and compressing JSON?
Minifying removes whitespace at the text level, producing smaller but still human-readable, valid JSON. Compression (like gzip or Brotli) is a binary encoding applied on top that shrinks the bytes further but must be decompressed before the JSON can be read or parsed.
Can I un-minify or beautify JSON back to a readable format?
Yes. Minification only strips whitespace, so the data is intact and any JSON formatter or beautifier can re-add indentation and line breaks. CalcCafe offers separate JSON formatting and viewer tools for that.
Does minifying JSON remove comments?
Standard JSON does not support comments at all, so valid JSON has none to remove. If your file contains comments (such as JSONC or JSON5), a strict JSON parser will reject it before minifying.
Will minifying change numbers or break precision in my JSON?
No. Minifying only deletes formatting whitespace between tokens; numeric literals are left exactly as they appear in the source, so values and their precision are unchanged.
Why does my JSON fail to minify?
The tool parses input first, so it will fail if the JSON is invalid — common causes are trailing commas, missing quotes around keys, single quotes instead of double quotes, or unclosed brackets. Fix the syntax error and try again.
Is whitespace inside JSON string values removed when minifying?
No. Spaces, tabs, and newlines that appear inside a quoted string are part of the value, not formatting, so they are kept. Only the insignificant whitespace between tokens is removed.
Does minifying JSON improve API performance?
It reduces the number of characters transferred, which can lower bandwidth and payload size, especially for uncompressed responses. The gain is smaller once gzip or Brotli compression is applied, since those already handle repetitive whitespace efficiently.
Is it safe to minify JSON that contains sensitive data?
This tool runs entirely in your browser and does not upload your input, so the data stays on your device. As with any tool, only paste sensitive payloads into pages you trust.