JSON minify · compress
JSON Minify: Compress JSON Without Uploading It
Paste JSON and get the same data on a single line, with the size before and after. Every byte of the work happens in your browser.
What JSON minify does
Minifying removes the characters that only exist to make JSON readable: the spaces after colons, the tabs and line breaks between keys, the indentation in front of every line. The data itself — keys, string values, numbers, arrays, booleans, null — comes out unchanged.
A pretty-printed object like this:
{
"name": "Ada",
"active": true
}
becomes one line:
{"name":"Ada","active":true}
The counter above each box shows the size before and after, so you can see exactly what the formatting was costing you.
Minify, format and stringify are three different jobs
| Job | What it does | Use it when |
|---|---|---|
| Minify | Removes whitespace, keeps the JSON | Shrinking a payload, a config file or a log line |
| Format / beautify | Adds indentation back | Reading or reviewing JSON |
| Stringify / escape | Converts JSON into an escaped string literal | Embedding JSON inside code or another string |
If you actually need an escaped string such as "{\"name\":\"Ada\"}", this is not the right page — use the JSON stringify converter instead.
When you want minified JSON
- Pasting a payload into API docs, a ticket or a chat message where line breaks get mangled.
- Shipping a config file where every byte of the bundle counts.
- Putting JSON into an environment variable, a URL parameter or a single database cell.
- Comparing two files by eye: minified, the whole document fits on one screen, so a difference is obvious.
What to watch out for
- Not every text file is JSON. A trailing comma, single quotes,
//comments or an unquoted key are all fine in JavaScript but invalid in JSON, and the converter will refuse them. Fix the input first. - Large integers lose precision. JavaScript parses numbers as doubles, so an ID longer than 2^53 — a snowflake, a big serial — can come back with its last digits changed. If the ID is a huge number, keep it as a string in the JSON.
- Duplicate keys collapse. JSON allows the same key twice; JavaScript keeps the last one and the duplicate disappears on the way out.
- Minify is not compression. It removes maybe a fifth of the bytes. gzip or Brotli on the server does far more — use both.
How to use this page
- Paste your JSON into the input box. The counter next to the label shows characters and bytes.
- Press Minify (or Ctrl / Cmd + Enter). If the JSON is invalid, the parser message appears instead of output.
- Copy the result. The line above the output reads
before > afterand the percentage saved.
Everything runs in your browser tab. Nothing you paste is sent to a server, logged or stored, and the page keeps working if you go offline afterwards.
Questions
Does minifying change what my JSON means?
No. The keys, values and their order stay exactly as they were; only the whitespace between tokens disappears. Parse the result and you get the same value back.
How much smaller will my JSON get?
It depends on how the file was indented. Two-space indentation usually saves 15–30%, deeper nesting or one-key-per-line exports save more. The counter above the output shows the exact byte counts and the percentage.
What exactly gets removed?
Spaces after colons and commas, indentation, line breaks and trailing whitespace. Nothing inside a string value is touched, so a message with spaces in it keeps them.
Is minify the same as stringify or escape?
No. Minify changes the formatting of JSON. Stringify turns a value into JSON text and escapes it so it can sit inside another string. Formatting adds indentation back for reading. Use minify when you want small JSON, stringify when you want an escaped literal.
Can I minify a JSON file without pasting it?
There is no upload box here, by design: open the JSON file in any editor, copy the contents, paste them in and press Minify, so the file never leaves your disk. For a whole folder, one line of Node does it locally: read the file, JSON.parse it, then JSON.stringify the result.
Why does it say my JSON is not valid?
Almost always one of four things: a trailing comma after the last item, single quotes around a key or value, a // comment, or an unquoted key. JSON allows none of them. The error message names the position, so you can fix that character and run it again.
Is my JSON uploaded anywhere?
No. The conversion runs in JavaScript inside your browser tab. Nothing is sent to a server, logged or stored, which is why the page is safe for payloads that contain customer data or keys — though for live secrets, dummy values are still the safer habit.
Can I use this JSON minifier on my phone?
Yes. The page is one responsive HTML page, so it works in Safari on iPhone and Chrome on Android: paste, tap Minify, tap Copy result. Very large payloads are slower on a phone because the work happens on the device.