Skip to content

JSON Minify

Minify JSON by removing whitespace.

Input
Output

No result

About JSON Minify

Minifying JSON removes every byte that carries no meaning — the indentation, the line breaks, the spaces after colons and commas. What remains is the same document in its most compact form, which is typically 20% to 40% smaller than the pretty-printed version depending on how deeply it nests.

The reason to do it is payload size on the wire. A configuration blob embedded in a build artifact, a fixture checked into a repository, or a document stored in a column with a size limit all benefit from dropping whitespace that a machine reader never looks at.

Validation comes free: since the input is parsed before being re-emitted, malformed JSON fails here rather than at the far end of whatever pipeline you were about to push it through. That is a considerably cheaper place to discover the problem.

This is a re-emission rather than a byte-level strip. The document is parsed and rebuilt, which means anything the parser does not accept — a comment, a trailing comma, a single-quoted string — stops the process instead of being tidied away, and no partial output is produced for you to work with. Practical limits follow from the same source: the minifier does not compress or encode the result, does not verify it against a schema, and does not report a size comparison, so the saving it produced has to be measured outside the page. Large documents are handled in memory as a single string, so the practical ceiling is the browser tab rather than anything the tool enforces.

How to use JSON Minify

  1. 1 Paste the JSON, formatted or not.
  2. 2 The minified single-line version appears immediately as you type.
  3. 3 Copy the output — it is identical in meaning to the input with all insignificant whitespace removed.

Frequently asked questions

How much smaller will my file be?

The saving depends on nesting depth, since deeper structures accumulate more indentation. As a rough guide, going from two-space indentation to fully minified typically reduces a nested document by a fifth to a third.

Are strings inside the JSON affected?

No. Whitespace inside a string value is data, not formatting, so it is preserved exactly. Only the structural whitespace between tokens is removed.

Can I get the readable version back?

Yes — run the output through JSON Formatter, which re-indents it. Because whitespace carries no meaning, the round trip is lossless and returns the same data in the same key order.

Should I minify JSON before sending it over an API?

It reduces the transfer size, but if the endpoint sits behind compression the gain is smaller than it looks — the compressor already removes much of the redundancy. The clearer benefit is for files stored or committed as-is, with no compression stage in front of them.

Free, online, and private

Free to use

JSON Minify is completely free. There is no account to create, no login, and no hidden charge or usage limit.

Runs online in your browser

It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.

Your data stays private

All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.

How JSON Minify behaves in detail

These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.

Parameter Value
Operation parse, then re-serialize with no spacing argument — whitespace removal only
Key order preserved exactly as given; keys are never sorted or reordered
Numbers re-serialized, so 1.0 becomes 1, 1e3 becomes 1000 and -0.50 becomes -0.5
Duplicate keys last one wins — the parse keeps only the final occurrence
Invalid input no error branch inside the tool; a parse failure surfaces as an error line instead of output

Compiled from the implementation of this tool and checked against it by itoolnet.

What JSON Minify does not do

Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.

  • Structure is untouched: this is a whitespace pass over re-serialized JSON, so there is no key shortening, no array-to-object restructuring and no size win beyond the blank space that was removed.
  • Numbers do not survive verbatim. Because the text is parsed and re-emitted, a literal like 1.0, 1e3 or 0.500 comes back as 1, 1000 and 0.5, so any downstream consumer that cares about the original spelling loses that information.
  • Duplicate keys are collapsed before you see anything, since the document is handed straight to the JSON parser, which keeps only the last value for a repeated key and discards the earlier ones without a warning.
  • This tool has no error handling, unlike the JSON Formatter in the same category. Invalid input is neither explained nor partly returned — the output area just shows the parser message and nothing is minified at all.

Tested and documented by itoolnet, the team that builds and maintains this site.

Share & embed this tool

Writing a guide or article? You are welcome to link to JSON Minify with the snippet below. It is free, runs entirely in your browser, and needs no signup.