JSON Minifier

Strip spaces and line breaks from JSON to make it as small as possible, with an option to sort keys.

Minified JSON

In short

What is the JSON Minifier?

The JSON minifier removes all unnecessary spaces and line breaks from valid JSON, giving the smallest text that means the same thing. It is handy for shrinking payloads, embedding JSON in a single line, or comparing two documents. Invalid JSON is reported with a clear message.

How to use it

  1. Paste valid JSON into the box.
  2. Tick sort keys if you want keys in alphabetical order.
  3. Copy the single-line result.
Questions

JSON Minifier — FAQ

How much smaller will my JSON get?

It depends on how much whitespace the original has. Heavily indented files shrink the most, while already compact JSON barely changes.

What does sorting keys do?

It orders object keys alphabetically at every level, which makes two JSON documents easier to compare.

Can it minify JSON with comments?

No. Comments are not valid JSON, so the tool reports an error until you remove them.

More Developer & Web tools