LocalFirstTools.com — data tools that never leave your device
No upload — everything runs on your device

Minify JSON

Minifying JSON removes every space, tab and newline between tokens — whitespace that RFC 8259 declares meaningless — producing the smallest byte-identical-in-meaning document. Paste JSON below and press Minify; the status bar shows bytes in, bytes out and the percentage saved.

Across the 26-document sample corpus (package manifests, API responses, configs — committed in scripts/fixtures/, re-serialized with JSON.stringify at 2-space indent, then minified by the same function this page runs), minification saved a median 27.1% of bytes (min 18.5%, max 54.3%). Deeply nested documents save the most: the corpus maximum, 54.3%, came from a deeply indented CI workflow config.

Input
Output

Formatted JSON will appear here.

Valid JSON10 lines151 BValidated locally

When it goes wrong

If the input does not parse, nothing is minified: the status bar reports the parser's message with the exact line and column — a trailing comma typically reads “Expected double-quoted property name at line 5, column 1”. Fix the first reported error and re-run; JSON parsers stop at the first violation, so repeat until the status turns green.

When to use this

Minify before embedding JSON in an HTTP response, a data attribute, an environment variable or any single-line context. Keep human-maintained files pretty-printed and minify at build time instead.

This page is a focused view of theJSON Formatter & Validator, which has the full set of options.

Frequently asked questions

Does minifying change the data?

No. JSON ignores whitespace between tokens (RFC 8259), so the minified document parses to exactly the same value. Whitespace inside string values is always preserved.

How much smaller does JSON get?

On our 26-document sample corpus, a median 27.1% (min 18.5%, max 54.3%) versus 2-space-indented input. Indentation depth drives the number: flat documents save least, deeply nested configs most. Gzip narrows but does not close the gap.

Is my JSON uploaded to minify it?

No. Parsing and re-serializing happen with JavaScript in this tab. The network tab in your browser's dev tools will show zero requests carrying your data.