JSON Minifier — Compress JSON Online
- This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.
Input
Tab indents · Shift+Tab outdents · Esc then Tab moves on
Your formatted JSON shows up here
Paste or type on the left, upload a file, or drop one onto the input.
JSON & data
About this tool
Paste formatted JSON and get the smallest valid version: all optional whitespace is removed while strings, numbers and structure stay exactly as they were. It is handy before storing JSON in a database, sending it in a request or embedding it in a config.
The input is validated first, so a missing comma or stray quote is reported with its line and column instead of silently producing broken output. You can still switch to Beautify or sort the keys from the same page. The status line shows how much smaller the result is: the bookstore example used in the JSONPath Tester, formatted with two-space indentation, is 564 characters and 346 when minified, about 39% smaller. Deeply nested data with more indentation saves more; data that is already compact saves almost nothing.
Other options come from the same editor: Upload or drop a .json file, Paste, Sort keys to order the keys A to Z at every level, and Download, which names the file after your upload with .min.json added. If your input is nearly JSON, with trailing commas, single quotes or comments, switch on Repair to tidy it before minifying; the repair step is listed so you can see what changed.
Minifying does not shrink the data itself. Long keys, repeated structures and numbers stay as they are, so for large payloads, gzip or Brotli on the server will save far more. Minified JSON is also hard to read, so keep a formatted copy for editing. Everything happens in your browser, and a Share link is only offered for small documents (about 30 KB).
Frequently asked questions
Does minifying change my data?
No. Only whitespace outside strings is removed. Keys, values and ordering are untouched unless you turn on Sort keys.
How much smaller will it get?
It depends on how much indentation the source has. Pretty-printed JSON is often 20–40% smaller once minified, and gzip on the server shrinks it further.
Can I minify JavaScript here too?
This tool is for JSON only. To tidy JavaScript, use the JavaScript formatter.
Is whitespace inside strings removed?
No. Spaces and escaped characters inside a string value are part of the data and are preserved.
How do I get it readable again?
Switch the mode to Beautify and choose 1 to 8 spaces or a tab for the indentation.