Skip to content
EVOA Toolbox

JSON Minifier

Minify JSON by stripping whitespace to shrink payloads, with optional key sorting. Validated and processed locally in your browser.

Processed locally in your browser. Your text is not uploaded.

Loading tool…

What this tool does

Turn readable, indented JSON into the most compact form by removing all insignificant whitespace. That is useful for embedding JSON in a URL, an environment variable, a data attribute or a test fixture, and for reducing the size of payloads you send or store.

Only whitespace outside of strings is removed, so the data is identical. The tool validates your input first and shows a line-and-column error if it is not valid JSON, so you never get a broken “minified” result. The before and after byte counts are shown so you can see exactly how much was saved.

You can optionally sort object keys so the minified output is canonical, which helps with hashing, caching keys and comparing documents. Everything runs locally in your browser.

How to use it

  1. 1Paste your JSON, upload a .json file or insert the example.
  2. 2Optionally enable “Sort keys alphabetically” for a canonical output.
  3. 3Check the size summary, then copy the minified JSON or download it as a .min.json file.

Supported formats

Standard JSON as text or a .json file. The output is valid JSON on a single line.

Privacy

This tool runs in your browser. The data you provide is processed on your device and is not sent to our servers.

Limitations

  • Minifying removes whitespace only; it does not shorten keys or remove data. Real transfer savings are smaller if your server already compresses responses with gzip or Brotli.
  • Invalid JSON is rejected with an error rather than being “repaired”.
  • Inputs over 5 MB are not processed automatically; you can opt in, but the page may become slow.
  • Large integers are preserved as written, but JavaScript code that parses them will round values beyond ±9,007,199,254,740,991.

FAQ

Does minifying change my data?

No. Only whitespace between tokens is removed. Whitespace inside strings is kept exactly as is.

Can I reverse it?

Yes. Paste the minified text into the JSON Formatter to get an indented version back. Original formatting choices such as indentation are not remembered, though.

Why is the saving small?

Documents that are already compact, or that contain mostly long strings, have little whitespace to remove. Savings are typically largest for deeply indented, pretty-printed JSON.

Related tools