Category: Developer tools

JSON Minifier

System ideaMissing a tool?

Validate strict JSON, drop insignificant whitespace, compare byte sizes

Paste JSON, validate it with the browser parser and strip insignificant whitespace into one compact line. Copy the result and compare UTF-8 byte sizes locally.

Valid JSON. No syntax errors found.

Output
{"site":"LocalTools","privacy":true,"tools":["json","css","text"]}
Original size81 BResult size66 B

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

This JSON minifier works the way the reference implementations do: the pasted text is validated with the browser's own JSON parser, then re-serialized, which removes indentation, line breaks and every other insignificant whitespace character and leaves compact single-line JSON. You get a valid-or-invalid status, the input and output sizes in UTF-8 bytes, a copy action, plus sample and clear buttons. Input is strict JSON only. JSON5, comments and trailing commas are rejected rather than repaired, and there is no malformed-JSON fixer. There is no pretty-printing, key sorting, schema validation or file upload, and no streaming for files larger than browser memory. Object key order and numeric representation follow JavaScript JSON behaviour, so values are preserved even though a number's written form can change. Note that minification is not gzip, Brotli or ZIP: it removes whitespace, not bytes from a compressed stream. Pasted JSON and the minified output stay in your browser and are never uploaded to LocalTools.

How to use it

  1. Paste strict JSON into the input area, or load the sample to see the behaviour.
  2. The browser's JSON parser validates it, then re-serializes without insignificant whitespace.
  3. Check the valid status and the UTF-8 size comparison, then copy the compact one-line JSON.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

What does JSON minification do?
It removes indentation, line breaks and other insignificant whitespace by parsing the JSON and serializing it again, leaving a single compact line that carries the same data.
Does JSON minification change the data?
No. Keys and values survive the round trip. Only the representation changes: key order and numeric formatting follow JavaScript JSON behaviour, so a number may be written differently.
Is minified JSON still valid JSON?
Yes. Whitespace between tokens is insignificant in JSON, so the compact output parses exactly like the formatted input.
What is the difference between a JSON minifier and HTTP compression?
Minifying deletes whitespace from the text itself; gzip or Brotli compress the byte stream in transit. This tool only does the first, and it does not produce ZIP or gzip files.
Can it handle comments, trailing commas or a JSON file upload?
No. Input is strict JSON pasted as text: JSON5, comments and trailing commas are reported as invalid rather than repaired, and there is no file upload, key sorting or schema validation.