JSON Minifier

Compress JSON to the smallest valid string - free, no signup required.

Input JSON
Minified Output
Original: 0 B Minified: 0 B Saved: 0.0%

JSON Full Form

JSON stands for JavaScript Object Notation - a lightweight, text-based, language-independent data interchange format used across virtually every HTTP API in production today.

What this tool does

Why minify JSON at all?

Indentation and line breaks make JSON pleasant to read, but every one of those spaces is a byte that has to be stored, sent and parsed. Minified JSON matters when the text has to fit somewhere tight: an environment variable, a single cell in a spreadsheet, a query string, a message queue with a size cap, or a fixture you want to keep on one line in a test file. It also makes logs easier to search, because each record stays on a single line.

How to use it

  1. Paste JSON into the Input JSON box, click Upload File to open a .json or .txt file, or click Load Sample.
  2. The output updates a moment after you stop typing. You can also click Minify at any time.
  3. Check the stats line, which shows the original size, the minified size and the percentage saved.
  4. Click Copy to put the result on your clipboard or Download to save it as minified.json.
  5. To go the other way, click Beautify. It rewrites the input with 2-space indentation and minifies it again on the right.

A small worked example

Take this 55-byte input:

{ "id": 42, "tags": [ "new", "sale" ], "price": 19.50 }

The minifier returns {"id":42,"tags":["new","sale"],"price":19.50}, which is 45 bytes, a saving of 18%. Notice that 19.50 is still 19.50. The tool only removes whitespace between values; it never rewrites a number, so trailing zeros stay and 1e3 stays 1e3.

What it changes and what it keeps

Whitespace inside string values is never touched, so "New Delhi" keeps both spaces. Keys keep their order and nesting stays exactly the same. Because the output is your own text with the gaps taken out, values that a parse-and-rewrite tool would change are kept as written:

When minify fails

The minifier refuses invalid JSON instead of guessing. A red message appears with the parser error, usually naming the position of the first bad character. Fix that spot and the output appears straight away. If your data uses JavaScript-only syntax such as comments or unquoted keys, clean it up first in the JSON Formatter, which points to the exact line and column.

Privacy

Everything runs locally in your browser. Your JSON is never sent to our servers. You can paste API responses with tokens, personal data, or internal IDs without them leaving your machine.

Frequently Asked Questions

How does this differ from the JSON Formatter?
The JSON Formatter is a full editor with tree view, JMESPath transforms, and format conversion. The JSON Minifier is a single-purpose tool - paste, minify, copy. Use it when you just need a compact string quickly.
Does minifying change the data at all?
No. The tool checks the JSON with the browser's parser, then removes only the spaces, tabs and line breaks between values from your original text, so long numbers keep every digit, 19.50 stays 19.50, escapes stay as written and repeated keys are all kept.
Why does minify fail on my JSON?
Common reasons: single quotes instead of double, trailing commas, unquoted keys, JavaScript comments, or undefined/NaN/Infinity values. The parser reports the character position of the first error.
How much can I realistically save?
Pretty-printed JSON is typically 30-60% larger than minified, depending on nesting depth. After gzip the wire savings are smaller, but the parser still does less work on a smaller input.
Is my JSON uploaded anywhere?
No. All minification happens in your browser using the native JSON API. Nothing is sent to our servers, logged, or cached outside the current browser tab.
Does key order change?
No. The output is your original text with the whitespace removed, so keys stay in exactly the order you wrote them. If you need alphabetical sorting, use the JSON Formatter, which has a sort-keys button.