JSON Minifier - Compress JSON Online
Minify or Beautify JSON
Paste JSON, or click "Load sample", and the minified version appears
with the byte count before and after. Switch to "Beautify" to go the
other way and get 2-space indented output. Turn on "Strip comments" if
your input is JSONC, such as a tsconfig.json or a VS Code
settings file. Invalid JSON shows the parser error instead of
producing broken output. Nothing is uploaded.
Before and After
This formatted input is 98 bytes:
{
"id": 42,
"name": "Widget",
"tags": [
"tools",
"hardware"
],
"inStock": true
} Minified, it is 68 bytes, about 30% smaller, and parses to exactly the same data:
{"id":42,"name":"Widget","tags":["tools","hardware"],"inStock":true} Large integers such as Discord or Twitter snowflake IDs are copied as written, not rounded, so the output is safe to send back to the API it came from.
When Minifying Matters
If your server already compresses responses with gzip or Brotli, the gain is smaller than the raw numbers suggest. Repeated indentation compresses very well, so a file that shrinks 30% when minified may only shrink 5% to 10% once both versions are gzipped. Minifying matters more where compression is not applied: environment variables, URL parameters, browser storage, message queues with size limits, JSON embedded in HTML, and one-line-per-record formats like JSON Lines.
For files people read and edit, such as config files in a repository, keep the formatted version. Readable diffs are worth more than a few bytes. To pretty-print with a different indent width, use the JSON formatter.
Related Tools
JSON Formatter & Beautifier
Format and beautify JSON with customisable indentation and syntax highlighting.
JSON Validator
Validate JSON syntax and get clear, human-readable error messages.
JSON Tree Viewer
Visualise JSON as a collapsible tree to explore deeply nested structures.
JSON Path Finder
Click any value in a JSON document to get its path expression.