Minify and format JSON without changing a single value

This JSON compressor removes every space, tab, and line break that JSON doesn't need, or formats compressed JSON into readable, indented text. Unlike most online tools, it never converts your data to JavaScript objects and back. It works directly on the text, so every number, string, and key comes out exactly as it went in. Then it can pack the result as .gz or .zip for even smaller files.

Everything runs in your browser. API responses, configs, and exports never leave your computer.

How to use it

  1. Paste JSON, open a .json file, or drag one onto the tool.
  2. Choose Minify for the smallest file, or a Pretty option to make it readable.
  3. If the file has comments or trailing commas, like tsconfig.json or VS Code settings, turn on that option.
  4. Copy the result, or download it as JSON, .gz, or .zip.

Why most JSON minifiers quietly change your data

The usual shortcut is to parse the JSON and print it again. That works for simple files, but JavaScript numbers can't hold every value JSON can:

In your fileAfter a parse-and-print minifierHere
1234567890123456789012345678901234567000Unchanged
1.101.1Unchanged
1e400nullUnchanged
-00Unchanged
{"a": 1, "a": 2}{"a":2}Unchanged, with a warning about the duplicate key
"caf\u00e9""café"Unchanged

Large integers like these are common: database IDs, Twitter/X and Discord snowflake IDs, and financial amounts stored as integers all exceed JavaScript's safe range. Changing them silently can break links between records. In testing, a parse-and-print minifier altered 378 of 800 sample documents. This tool altered none.

Verified after every run

After minifying or formatting, the tool reads its own output back as strict JSON and compares every token with the original. The green Verified badge means the data is identical, character for character, apart from whitespace. It also tells you how many large integers and exact decimals were protected.

Comments, trailing commas, and JSON Lines

  • JSON with comments (JSONC): config files like tsconfig.json, .eslintrc.json, and VS Code's settings.json allow // comments and trailing commas. Turn on the option to accept them. The output is standard JSON that any parser can read.
  • JSON Lines (.jsonl, .ndjson): one record per line, as in logs and data exports. It's detected automatically, and each record is minified on its own line.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Validation, minifying, and compression all happen in your browser.

How much smaller does minified JSON get?

Indented JSON usually shrinks 20 to 40 percent when minified. Gzip shrinks it much further, often 80 to 95 percent, because JSON repeats the same keys over and over.

Can it fix invalid JSON?

It doesn't guess at fixes, because guessing can change data. Instead it shows exactly where the problem is, with the line, the column, and a pointer, and explains common mistakes like single quotes, unquoted keys, NaN, and trailing commas.

Does it sort keys or remove null values?

No. Key order and every value stay as they are. Only whitespace changes, plus comments and trailing commas if you allow them.

How large a file can it handle?

Files up to 200 MB work in most desktop browsers. A 2.8 MB file took about 70 milliseconds in testing, and processing runs in the background so the page stays responsive.

Compression Tool Library

Flipper File