JSON Minifier

Strip JSON down to a compact single line — with size savings, validation, and one-click beautify.

JSON229 B
Valid JSON · 229 B · runs locally

What this tool does

Paste JSON — pretty-printed API responses, config files, fixtures — and hit Minify to strip it to one compact line, ready for a payload or an env var, with the percentage saved shown in the status bar. Beautify goes the other way when you need to read it. Validation runs as you type with the failing line underlined in the editor, and an optional sort keys pass makes output stable for diffing. Everything runs in your browser.

How to use it

  1. Paste your JSON into the editor — or hit Upload to open a .json file from your machine.
  2. Click Minify to strip whitespace in place — the status bar shows the size and the percentage saved — or Beautify to pretty-print it.
  3. Toggle sort keys if you want alphabetically ordered, diff-stable output — it re-applies the active action immediately.
  4. Copy the result, or Download it — the file follows the active mode: .min.json after Minify, .json otherwise.

Frequently asked questions

Is my JSON uploaded anywhere?
No. Parsing and minification run entirely in your browser. Nothing is sent to a server, logged, or stored.
How much smaller does minified JSON get?
It depends on how much whitespace the input carries — a typical pretty-printed API response shrinks by 20–40%. The status bar shows the exact before → after byte counts and the percentage saved.
Does minifying change the data?
No. Minification only strips insignificant whitespace — the document parses to exactly the same values. The output is standard JSON that any parser accepts. (With sort keys on, object keys are reordered alphabetically, which changes the text but not the data.)
What does "sort keys" do?
It recursively reorders object keys alphabetically before minifying. Two documents with the same data then minify to the same string — handy for diffing, deduplicating, and cache keys.
What happens when the JSON is invalid?
The status bar turns red and names the failing line along with the reason — a trailing comma, an unquoted key, a missing bracket — and the same line is underlined in the editor.