JSON Minifier

Strip whitespace and see how many bytes you save

Input (JSON)

Minified

212 bytes to 155 bytes, 27% smaller

JSON Minifier guide

Whitespace makes JSON readable for people but adds bytes for machines. The JSON Minifier removes every space, tab, and line break outside strings, so the data is as small as it can be for an API payload, a config value, or a URL, and it shows how much you saved.

What minifying removes

Only whitespace between values is removed. Text inside strings, spaces included, stays exactly as it was, and the data itself doesn't change. The same exceptions as formatting apply: 1.0 is written as 1, and very large integers lose precision, which the tool warns about.

When it helps

  • Sending JSON in an API request or response, where every byte is transferred.
  • Storing JSON in a database column, an environment variable, or a query parameter.
  • Embedding data in HTML or JavaScript.

Minifying and gzip

If your server already compresses responses with gzip or Brotli, minifying saves less, because compression removes most of the repeated whitespace too. It still helps wherever the JSON is stored or sent uncompressed.

Example

{
  "id": 1042,
  "active": true
}

// minified

{"id":1042,"active":true}

Frequently asked questions

How do I minify JSON?
Paste it into the input. The minified version appears on the right with the size before and after, ready to copy.
Does minifying change my data?
No. Only whitespace outside strings is removed, so a program reading the JSON gets the same values. The exception is integers too large for JavaScript, which the tool warns about.
How do I make minified JSON readable again?
Use the JSON Formatter, which re-indents minified JSON with 2 spaces, 4 spaces, or tabs.
Is minified JSON faster?
It is smaller, so it transfers faster, especially without gzip or Brotli. Parsing takes about the same time.