JSON Minifier

–paste JSON - whitespace stripped, syntax preserved
What gets removedWhat stays
Spaces between tokensStrings (spaces inside quotes preserved)
Newlines between tokensNumbers, booleans, null
Tabs and indentationObject and array structure
Minification strips all insignificant whitespace from JSON per RFC 8259 (The JavaScript Object Notation), the standard that defines JSON. Whitespace inside string values is always preserved - only structural whitespace between tokens is removed. Bottom line: a well-formatted JSON file with 2-space indentation loses about 30-50% of its size when minified, which matters for API payloads and config files sent over the wire. Formatted output: JSON formatter, tabular view CSV to JSON, hashing SHA-256 hash, types MIME types table.

JSON minification removes all whitespace that is not inside string values - spaces between tokens, newlines, tabs and indentation. The result is a single-line JSON string that parses identically but is 30-50% smaller, which matters for API payloads, config files and data transfer.

The tool is careful about one thing: whitespace inside string values is always preserved. {"message": "hello world"} keeps the space in hello world - only the space between the colon and the opening brace is removed.

How to use

  1. Paste formatted JSON; the minified output appears instantly in the note below the result.
  2. Copy copies the full minified string; use the JSON formatter to go the other direction.
  3. The tool validates the JSON first - invalid input gets an error message, not a broken output.

Frequently asked questions

How much smaller does minification make JSON?

Typically 30-50% for indented JSON with 2-space indentation - the savings come from removing newlines, indentation spaces and spaces after colons and commas. Single-line JSON with no extra whitespace gains almost nothing because there is nothing to remove.

Does minification change the JSON data?

No - the RFC 8259 spec says whitespace between tokens is insignificant. JSON.parse produces identical objects from the minified and formatted versions. The only exception: whitespace inside string values is part of the data and is always preserved.

Should I minify JSON config files?

Only if they are machine-read exclusively. Human-edited config files should stay formatted - the whitespace is documentation. A common pattern: keep the formatted source in version control and minify at deploy time.

What is the difference between minify and compress?

Minification removes characters; compression (gzip, brotli) re-encodes the bytes. They stack: minify first to reduce the character count, then gzip the result. A minified JSON file compresses better than a formatted one because the reduced character variety makes patterns easier to find.

Related tools