Tools

JSON Minifier

Compress JSON by removing all whitespace

Waiting for input.

How to minify JSON

  1. Paste formatted JSON into the editor.
  2. Press Minify. All spaces, tabs and line breaks between tokens are removed, while whitespace inside strings is kept exactly.
  3. Check the byte count in the status line, then copy the result or download it as a .json file.

Why minify JSON?

Pretty-printed JSON is easy to read but can be 20–40% larger because of indentation. Minified JSON is the standard for sending data over a network, storing it in a database column or environment variable, embedding it in an HTML attribute, or pasting it into a single-line config field. Smaller payloads mean faster API responses and lower bandwidth costs, especially on mobile connections.

Minifying also validates your JSON: if there is a syntax error, the minifier refuses to run and tells you the exact line and column of the problem. When you need to read the data again, press Format to expand it with 2 or 4 spaces or tabs.

The minifier uses the browser's built-in JSON parser and serialiser, so the output is guaranteed to be valid, compact JSON. Your data never leaves your device.

FAQ

Does minifying JSON change the data?

No. Only whitespace between tokens is removed. Keys, values and whitespace inside strings are unchanged, so the parsed result is identical.

How much smaller does JSON get?

Typically 10–40%, depending on how deeply nested it is and the indentation used. After gzip compression the difference is smaller, but still worthwhile.

Is minified JSON still valid?

Yes. Minified JSON is standard JSON that any parser can read.