JSON Minifier
Minify JSON by removing unnecessary whitespace while preserving valid JSON structure. Useful for compact API payloads, configuration files and storage.
JSON Minifier online
Minify JSON by removing every insignificant whitespace character — same data, fewer bytes — for payloads, embedded config and copy-paste into size-sensitive places.
How to use this tool
- Paste your JSON into the input box.
- Click Minify JSON. The input is parsed first, so invalid JSON is reported instead of producing broken output.
- Copy the single-line result from the result panel.
Common uses
Shrinking JSON embedded in HTML or tokens, preparing compact fixtures for tests, fitting payloads into size-limited fields, and removing formatting noise before diffing two documents by eye.
How it works
The tool parses the input with the browser's strict JSON parser and writes it back in compact form. Whitespace between tokens disappears; whitespace inside strings is data and is preserved exactly. A side effect of going through a real parser is that number formatting normalises — 1e2 comes back as 100 and 1.50 as 1.5 — while key order is kept as written.
Worked example
The pretty document
{
"name": "Ana",
"age": 30
}takes 32 bytes. Minified — {"name":"Ana","age":30} — it takes 24, a 25% reduction before any compression. On nested API payloads the saving from indentation alone typically runs 15–30%.
Privacy and browser processing
Your JSON is minified in your browser with JavaScript — it is never uploaded or stored.
Frequently asked questions
Is minified JSON still the same data?
Yes — parsing the minified text yields exactly the document you started with. Only formatting whitespace is removed; string contents, including their spaces, are untouched.
Why did my number change shape (1e2 became 100)?
The value passes through the parser and is written in the engine's canonical form. The number is identical; only its spelling changes. If exact number spelling matters (very long decimals, trailing zeros), minify with a text-only tool instead.
What if my JSON is invalid?
You get the parser's error rather than partial output. Fix the syntax first — the JSON Validator on this site isolates the problem — then minify.
Does it remove comments?
Standard JSON has no comments, so commented input fails to parse. Strip comments before minifying, or treat the file as JSONC and use tooling for that format.
Is my JSON uploaded?
No. Minification runs in your browser; nothing leaves the page.