JSON Minify
Minify JSON to a compact single line.
Loading…
About JSON Minify
Smaller payloads help when JSON sits in a database column, an embedded script tag or a request body. Paste a document and every space, tab and line break outside strings disappears straight away, with no button to press. Numbers keep their original text, so 1.10 stays 1.10 and large integers stay exact, and repeated keys are left in their original order. Text that is not valid JSON is not guessed at: you get an error and no output.
Features
- Removes spaces, tabs and line breaks outside strings
- Updates live on every edit
- Number text such as 1.10 and 12345678901234567890 kept exactly
- Key order and repeated keys preserved
- Invalid JSON is reported instead of being repaired
Limitations
- Escape sequences inside strings are rewritten in their standard form, so \u00e9 comes out as é: the value is identical but the characters differ.
- Nesting deeper than 1,000 levels is refused, as is output longer than 20,000,000 characters.
- Downloading the result, saved as output.txt, needs a free account; copying it does not.
How it works
- Paste or type JSON into the JSON Input panel.
- Watch the Minified JSON panel fill in as you type; there is no Minify button to press.
- If the text is not valid JSON, an error message appears and the output stays empty.
- Select Copy Output to copy the result, or Download to save it as output.txt.
Example input
{
"user": "auro",
"active": true,
"roles": ["admin", "editor"]
}Frequently asked questions
- Yes. Only whitespace that carries no meaning is removed, so any JSON parser reads the compact text exactly as it read the original. The tool parses your input first, which is why output only appears for valid JSON.
- That depends on how much indentation the input has. A deeply indented, pretty-printed document shrinks the most, while text that is already compact stays the same size. Keys and values are never shortened.
- Yes. Paste the compact text into the JSON formatter and choose an indent. You get a clean layout, though not the exact original line breaks, because minifying discards them.
- The input is not strict JSON. Comments, trailing commas, single quotes and unquoted keys are errors here and are not removed or fixed for you. Correct the text, and the output appears on the next keystroke.
