Skip to content
Expensico

JSON Minifier

Minify JSON by removing all unnecessary whitespace, and see exactly how many bytes you saved. Validates as it minifies.

Runs in your browser. Everything you enter stays on your device. Nothing is sent to a server.

How to use the JSON Minifier

  1. Paste or open your JSON.
  2. The minified version appears instantly, with the bytes saved.
  3. Copy it or download it as a .json file.

What minifying removes

Minifying removes every space, tab and line break that isn't inside a string. The data is identical — any JSON parser reads the minified and the formatted version the same way — but the file is smaller, which helps when embedding JSON in URLs, HTML attributes, environment variables or network payloads.

Minify vs compress

Web servers usually compress responses with gzip or Brotli, which already shrinks whitespace dramatically. Minifying still helps where compression isn't applied, such as local storage limits or configuration values. To make minified JSON readable again, use the JSON formatter.

Example

A 2 KB pretty-printed API response with 2-space indentation typically shrinks by 20–40% when minified, depending on how deeply it is nested.

Frequently asked questions

Will minifying break my JSON?

No. The input is parsed and re-serialised, so the output is guaranteed to be valid JSON with the same data. Invalid input is reported instead.

Can I minify JSON with comments?

Comments aren't valid JSON. Remove them first; the error message points to where they are.

Is what I enter stored or sent anywhere?

No. Calculations and processing happen in your browser. Nothing you type is sent to our servers. Some tools remember your last input in this browser's local storage for convenience; you can clear it at any time.