Skip to main content

JSON Minifier

Smallest possible JSON, with the savings measured.

Minifying removes every space, tab and newline that a parser ignores. For payloads sent over the wire that is free bandwidth: a formatted document is often 20–40% larger than the same data minified.

Input JSON

Size: 0 BLines: 0

Minified JSON

Paste valid JSON to see the output.
Size: 0 BLines: 0

What does minifying JSON do?

It parses the document and serializes it again with no optional whitespace: no indentation, no newlines, no space after a colon or a comma. The data is untouched — only the bytes a parser would skip are removed.

Jsonviewpro reports the before and after size in bytes and the percentage saved so you can judge whether it is worth it.

When to minify

  • API responses and request bodies, where every kilobyte is transfer time.
  • JSON embedded in HTML, JavaScript bundles or data attributes.
  • Files stored in bulk, such as logs or event archives.
  • Anywhere a size limit applies — cookies, query strings, message queue payloads.

When not to minify

Do not minify files that people edit or review: configuration, fixtures, seed data or anything in version control. A minified file produces a single-line diff on every change, which destroys code review.

Also note that gzip or brotli compression, which most servers apply automatically, already removes most of the cost of whitespace. Minifying on top of compression usually saves a few percent, not forty.

Is minified JSON still valid?

Yes. Whitespace between tokens is insignificant in JSON, so a minified document parses identically. You can always run it back through the formatter to make it readable again — nothing is lost.

Frequently asked questions

Can I undo minification?
Yes. Whitespace carries no information, so the formatter reconstructs a readable version at any time.
How much smaller will my JSON get?
Typically 10–40%, depending on how deeply nested the document is and how short its keys and values are. Jsonviewpro shows the exact figure for your input.
Does minifying remove null values or empty objects?
No. Minifying only removes whitespace. Removing data would change the meaning of the document.