Developer Tools

JSON Minifier

Minify JSON by removing whitespace and formatting.

How to Use JSON Minifier

1

Paste your formatted JSON into the input box, or load it from a .json file on disk.

2

Optionally enable the setting that keeps a trailing newline, otherwise the output is one continuous line.

3

Click the "Process" button to strip all insignificant whitespace outside of JSON strings.

4

Copy the minified output or download it, and check the size savings reported below the result.

Features

Removes whitespace only outside string values, so text content is never altered
Reports original size, minified size, and the exact percentage saved
Produces a single-line payload that is safe to embed in HTML or a script tag
Rejects invalid JSON instead of emitting a broken minified file
One-click copy plus a .json download for use in build pipelines
Minification happens in the browser, so nothing is uploaded

Frequently Asked Questions

It depends entirely on how deeply indented the original was. A typical pretty-printed API response shrinks by 30 to 60 percent, while an already compact payload may barely change. The tool shows the before and after byte counts so you know exactly what you gained.
No. The minifier only removes whitespace that JSON treats as insignificant, which is whitespace between tokens. Spaces, newlines, and tabs that are part of a quoted string value are content and are preserved byte for byte.
Yes, it is free, needs no account, and has no practical cap. Very large documents take a moment longer to process in the browser but there is nothing to sign up for and no watermark on the download.
It is safe to do, and it reduces the bytes your server sends. Keep in mind that gzip or Brotli already removes most redundant whitespace, so the extra gain is smaller than the raw percentage suggests, though it is still free savings.

About JSON Minifier

Whitespace inside a JSON document is pure overhead once the data has been parsed, yet pretty-printed files are often shipped straight to a CDN. The JSON Minifier strips every space, newline, and indent character that sits outside of a string value, collapsing the whole document into a single line. Typical results are a 30 to 60 percent reduction before compression even kicks in.

The important detail is what it leaves alone. Whitespace that appears inside quoted strings is content, not formatting, so spaces in "New York" and newlines inside a description survive untouched. String escapes, unicode sequences, and numeric literals are all preserved exactly as parsed.

Invalid JSON is rejected rather than silently mangled. That means a minified file that still parses is a file you can trust, which is the difference between this and a naive find-and-replace over whitespace characters. Pair it with gzip or Brotli on your server for the full win.

When to Use This Tool

  • Shrinking API payloads before sending them to constrained mobile clients
  • Embedding JSON inside a script tag, a serverless function, or a template file
  • Comparing two payloads byte-for-byte after removing formatting differences
  • Producing a content hash or fingerprint from a JSON document for cache busting
  • Reducing storage for configuration blobs and test fixtures in a repository