JSON Minifier
Remove every optional byte from a JSON document. The output is checked by the same parser that validates the input, and the before/after counts show exactly what was saved.
Runs entirely in your browser — your JSON is never uploaded.
Character counts are measured on the text exactly as entered. Byte counts are UTF-8 encoded sizes, which is what a network response or file on disk would use.
How to minify JSON
- Paste an indented document into the left panel, or press “Load example” for a verbose sample with nested objects.
- Press Minify JSON The document is parsed first, so invalid input fails loudly instead of producing a broken result.
- Read the comparison above the status line: characters before and after, characters saved, and the reduction percentage.
- Copy or download the compact output. The downloaded file is UTF-8 encoded JSON with a timestamped name.
What minification actually removes
JSON uses whitespace only as a separator between tokens. Everything else — the quotes around a key, the colon after it, the comma between members — is structural and has to stay. So a minifier removes:
- Indentation at the start of every line
- Line breaks between members and array items
- Spaces around colons and commas
- Trailing newlines at the end of the document
It does not remove or reorder anything inside a string, and it does not touch the keys themselves. Minified JSON is not compressed JSON — it is the same document with the formatting taken out.
When it is worth doing
- Request and response bodies that are measured in raw bytes, for example payloads stored in a database column or embedded in a log line.
- Bundled fixtures used by tests, where readability is provided by the formatter on demand rather than by the file itself.
- Inline JSON inside an HTML attribute or a script tag, where line breaks and indentation add bytes to every page view.
Minifying is usually the wrong choice for anything a human reviews: config files in a repository, example payloads in documentation, and anything that appears in a code review. A single-line diff of a minified file tells you nothing about what changed.
Characters, bytes and what the numbers mean
Character counts are taken from the text exactly as it appears in the editor. Byte counts are the UTF-8 encoded size, which is what a file on disk or a network response would contain. The two differ as soon as a document contains non-ASCII text: an accented letter or a CJK character takes two or three bytes even though it counts as one character.
That is why the summary reports both. A document full of non-ASCII strings can have a modest character reduction and a larger absolute byte reduction — or the other way round, if the indentation was mostly single spaces.
To go the other way, use the JSON formatter to pretty-print the result again, or the validator if you only want to know whether a document parses.