JSON Minifier
Processed Client SideStrip all whitespace to compress JSON for production. See exactly how many bytes you save.
Bookmark this tool now — skip the search next time you need it.
About JSON Minifier
This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.
The JSON Minifier strips every space, newline, and indent out of a JSON document and tells you exactly how many bytes that saved. Formatting exists for human readers, not for parsers: a pretty-printed config or API fixture is routinely 20–40% whitespace, and none of it survives JSON.parse. Paste a document, press Minify, and you get the compact single-line form together with a before → after byte count and the percentage saved. An “Escape as string” toggle goes one step further and wraps the minified result in a JSON string literal, ready to embed inside another JSON document, a shell variable, or a database column. Anything that will not parse is reported with the failing line highlighted.
Key features
- One-click minification of any valid JSON document down to a single compact line
- Byte-accurate readout: original size, minified size, bytes saved, and the percentage smaller
- Sizes measured in real UTF-8 bytes, so emoji and non-Latin text are counted the way a server counts them
- “Escape as string” toggle that wraps the minified output as a JSON string literal for embedding
- Parse errors shown with the parser’s message and the offending line highlighted in the input editor
- Syntax highlighting on both the input and the minified output
- Live line count and byte size on the input pane as you type
- Copy the result in one click, or Clear to start again
- Runs entirely in your browser — payloads containing tokens or customer data never leave your machine
How to use it
- Paste or type your JSON into the input pane; the line count and size update as you go.
- Press Minify. Valid JSON is compacted immediately; anything malformed reports the error and highlights the line.
- Read the size row underneath — original → minified, plus the bytes and percentage saved.
- Switch on “Escape as string” if the result needs to sit inside another JSON document or a string constant.
- Copy the output and paste it wherever the compact form is needed.
Tips & common mistakes
- Minifying changes nothing a parser can see — same keys, same values, same order. It only removes the whitespace, so it is always safe to send minified JSON to an API that accepts JSON.
- Do not minify files that humans edit. package.json, tsconfig.json, and application config belong pretty-printed in the repository; minification is for what goes over the wire or into storage.
- If the transport already uses gzip or Brotli, most of the whitespace cost has been paid for you — repetitive indentation compresses extremely well. Minifying still helps for uncompressed request bodies, localStorage, and JSON embedded inside other formats.
- How much you save tracks nesting depth and indent width: a deeply nested document indented with 4 spaces can drop by well over a third, while a flat one barely moves.
- Use “Escape as string” when a field in one JSON document has to hold another JSON document — a webhook body stored as a string, or a config value read back with a second parse.
- Byte counts are UTF-8, not characters. An accented letter costs two bytes and most emoji cost four, which is why the size may exceed the character count.
- JSON has no comments. If your file contains // or /* */ it is JSONC, and it must be stripped before this or any other strict parser will accept it.