JSON Minifier

Minify JSON by removing whitespace and formatting.

Minify JSON by removing every space, tab and line break that isn't inside a string. Paste formatted JSON and get the same data on one line, with the size before and after so you can see the saving. The JSON is parsed first, so the tool refuses invalid JSON rather than producing something broken. Minified JSON is smaller to send, store and paste into places that need a single line, such as environment variables.

Common use cases

  • Shrink a JSON payload for an API request or a test
  • Put JSON into an environment variable or a single-line config
  • Reduce the size of a static JSON data file
  • Compare two JSON values as one line each

How to use

  1. Paste the JSON.
  2. Copy or download the minified result.
  3. Check the size saving shown underneath.

FAQ

Does minifying change the data?

No. Only whitespace between values is removed. Strings, numbers and key order stay the same.

How much smaller does it get?

Typically 10 to 30% for indented JSON. Gzip compression on servers saves much more, so minifying matters most where compression isn't used.

How do I make it readable again?

Paste it into the JSON formatter.