Skip to content
Join

JSON minifier

Minify JSON, beautify it back, and see the real compressed size. Flags duplicate keys your parser silently drops.

on-device json -> json.min free · no account

JSON Minifier JSON → MIN

Strip the whitespace, see what it saves once compression is applied, and catch the duplicate keys your parser drops without a word. All in your browser.

Action
Indent
Options
Working
Raw bytes
Original
Result
Saved
original
result
Compressed, as a server would send it
Measuring

Measured in your browser with the same algorithms a server uses. Treat it as a comparison, not a promise — your host or CDN may use a different compression level, or Brotli, and will produce a different transfer size.

Copied
Your JSON is parsed in your browser — nothing is uploaded, even when you drop a file. Ctrl+Enter

processed in your browser · never uploaded

01

Paste or drop your JSON

Paste into the left pane, or drop a .json file anywhere on the tool. Drop several files at once to process them as a batch.

02

Press Minify

Or press Ctrl and Enter. Use Beautify, or Ctrl Shift Enter, if you want it indented for reading instead.

03

Read the size panel

Raw bytes before and after, then the compressed size measured with the same algorithms a server uses. The compressed row is the one that reflects real transfer cost.

04

Copy, download, or fix what it found

Copy the result, download it, or download a whole batch as a ZIP. If duplicate keys or a parse error were found, the panels above the output tell you exactly where.

Formats & limits

What goes in, what comes out.

Format field guide
Input Output Typical saving Best for
Indented JSON Single-line JSON 20-40% raw, far less after gzip Shipping config and API payloads
Minified JSON Indented JSON Adds bytes - readability, not size Reading an API response
Multiple .json files ZIP of minified files Same per file Cleaning a folder of fixtures
Why this one

Built against the ways these tools disappoint.

We ran the same files through the popular alternatives first. These are the gaps we found, and what this tool does instead.

01

Show only the raw byte saving, which overstates the benefit because servers compress JSON before sending it.

Measure the compressed size in your browser with gzip, deflate and Brotli, alongside the raw number.

test: Minify any indented file and compare the two rows. The raw saving is large; the compressed saving is usually a fraction of it.
02

Accept duplicate keys without a word, because JSON.parse keeps the last value and discards the earlier one silently.

Scan the raw text before parsing and report every duplicate with its key path and both line numbers.

test: Paste {"id":123,"name":"Priya","id":456}. Every other minifier returns it as valid with id 456 and no warning.
03

Report a syntax failure as "Invalid JSON", leaving you to find the character yourself.

Give the line, the column, a caret under the exact character, the actual cause, and a deterministic repair that lists what it changed.

test: Paste {"a":1,} and read the message. It names the trailing comma rather than restating the browser error.
The detail

How this actually works.

A JSON minifier strips out every space, line break and indent, leaving the smallest text that still parses to the same data. {"a": 1} and {"a":1} are identical to any parser. For a pretty-printed file that is usually a 20 to 40 percent cut in raw bytes, depending on how deeply it was indented.

That number, on its own, is misleading. Almost every server sends JSON compressed, and compression is very good at repeated whitespace, so most of the indentation you just removed would have cost little on the wire anyway. This tool measures both: raw bytes, and the compressed size using whichever of gzip, deflate and Brotli your browser can run. Nothing is estimated.

Treat the compressed figure as a comparison, not a promise. Your host or CDN may use a different compression level or a different algorithm and will produce a different transfer size. What it tells you reliably is the shape of the saving – whether minifying moves the needle for your file, or whether it is noise.

Duplicate keys, and why your parser stays quiet

JSON allows the same key twice in one object. Parsers do not error. They keep the last value and discard the earlier one, silently:

{
  "id": 123,
  "name": "Priya",
  "id": 456
}

That parses cleanly and id is 456. The 123 is gone. When the duplicate comes from a bad merge or a template loop, the discarded value can be an entire nested object, and nothing reports it. This tool scans the raw text before parsing and names every duplicate: the key path, the line it first appeared on, and the line it repeated on. The output already reflects what the parser did, so fix the source if the earlier value mattered.

When the JSON will not parse

The error panel gives the line and column, prints the offending line with a caret under the exact character, and names the cause instead of repeating the browser message. It recognises trailing commas, single quotes, unquoted keys, Python None, True and False, NaN and Infinity, comments, and JSON that has been escaped into a string.

Where the fault is mechanical, a repair button appears. The repair is deterministic rather than a guess, and it lists every change afterwards. One change deserves a second look: NaN, Infinity and undefined have no JSON equivalent, so they become null. That loses information, which is why the tool tells you rather than doing it quietly.

Sorting keys

The sort option reorders keys alphabetically, all the way down. The data is unchanged and the JSON stays valid, but key order is not preserved. Useful when you want two files to diff cleanly or a stable output to commit. Leave it off if the order in your file carries meaning.

When this is not the right tool

For reading a large, deeply nested payload, a textarea is the wrong shape – a collapsible tree view like JSON Editor Online is built for that. If minifying belongs in a build step, do it locally with jq -c . or a bundler plugin rather than a browser tab. For converting JSON into CSV, YAML or XML, CodeBeautify carries a far broader converter set than we do today. And JSON5 or JSONC config files are not JSON: this tool will offer to strip the comments and trailing commas, but if you need them preserved, use a JSON5-aware editor.

Everything here runs in your browser. There is no upload, no account and no file-size cap beyond your device’s memory. Large files are processed on a background thread so the page stays responsive.

Last reviewed August 2026 · this tool runs on-device.

FAQ

The questions people actually type in.

does minifying json change the data

No. Minifying only removes whitespace between tokens, so the parsed result is identical. That is why the tool can safely parse your input and write it back out.

how to minify a json file

Use Open files, or drop the file anywhere on the tool. Drop several at once and each is processed separately, with a ZIP download for the whole batch.

is there a size limit on this json minifier

No account, no per-file cap. The practical limit is your device's memory, since the file is never uploaded. Large files are processed on a background thread so the page stays responsive.

is it safe to paste api responses into a json minifier

Your JSON is parsed in your browser and never sent anywhere. There is no server to receive it - load the page, disconnect from the network, and the tool still works.

what is the difference between minifying and compressing json

Minifying removes whitespace from the text. Compression is applied by your server when it sends the file. This tool measures both, so you can see how much minifying adds once compression is already in play.

can i unminify or beautify json here

Yes. Beautify re-indents with 2 spaces, 4 spaces or tabs. Minify and beautify are reversible and neither alters your data.

why does it say duplicate keys when my json is valid

Duplicate keys are valid JSON but almost always a bug. The parser keeps the last value and drops the earlier one with no warning, so the tool flags them with line numbers.

does this support json5 or json with comments

Not as valid input - those are different formats. If comments or trailing commas are detected, the repair option removes them so the result is standard JSON.

Next

Tools people use with this one.

All 29 tools

URL Encoder Decoder

Encode or decode URLs and query values — Component, Full URL or Form mode, single or batch. Decodes recursively, breaks a URL into its parameters, and runs entirely in your browser.

on-device Open

Extract URLs from Text

Paste messy text, an email, a log or HTML and pull out every link. Get URLs, domains or emails, dedupe and sort, copy or download. Everything runs in your browser.

on-device Open