JSON Minifier
Strip every unnecessary byte from JSON — whitespace and indentation only, structure untouched — with a before/after size comparison.
Reviewed 17 November 2026 · Free · No account needed
How to use
- Paste the formatted JSON.
- The minified output appears live with the size comparison.
- Copy the result for API payloads or config files.
Example
Input: { "a": 1, "b": 2 }
Output: {"a":1,"b":2} · bytes saved shown live
How it works
The input is parsed as JSON and re-printed with all unnecessary whitespace removed, producing the smallest valid representation of the same data.
Parse with JSON.parse, then re-print with JSON.stringify(value) — no indent argument, so every formatting whitespace character disappears while the data is untouched. Sizes are compared as UTF-8 byte counts before and after.
{ "a": 1, "b": 2 } becomes {"a":1,"b":2}, with the bytes saved shown live.
Edge cases to know
- Whitespace-only: no key shortening, value mangling or schema changes — the output is the same data in the smallest legal form.
- Input must be valid JSON; the parse error is reported if it is not.
- Numbers keep full precision — no float re-rounding.
Limits & compatibility
- Whitespace-only — no key shortening, value mangling or schema changes.
- Input must be valid JSON; the error is reported if it is not.
- Numbers keep full precision (no float re-rounding).
Privacy
Your JSON never leaves the browser. There is no server call, no storage and no logging of content.
Guides that use JSON Minifier
Related tools
Questions about JSON Minifier
Does minifying change my data in any way?
No. The input is parsed and re-serialised, which strips whitespace and indentation only — keys are not shortened, values are not altered and the structure is untouched. Numbers keep full precision with no float re-rounding. The only way to lose data is to start with invalid JSON, and that is reported as an error rather than minified.
How many bytes will I actually save?
It depends entirely on how much whitespace your input carries. A heavily indented config file can shrink dramatically, while already-compact JSON saves almost nothing — the before/after byte comparison is shown live so you can judge before copying. Separator bytes between items are mandatory in JSON, so no minifier can remove them.
Does it work on JSON5, JSONC or NDJSON?
No — the input must be strict JSON, because the value is parsed with JSON.parse before re-serialisation. Comments, trailing commas and one-object-per-line streams are all rejected with the parser's error message. Convert those formats elsewhere first; this tool only guarantees a byte-minimal version of input that is already valid JSON.