JSON Minifier
Strip whitespace from JSON live — with lenient repair (comments, trailing commas, single quotes), precise code-frame errors, and an accurate UTF-8 compression summary.
About this ToolHow it works, benefits & use casesTap to collapse
Compress JSON to its smallest valid form by stripping every space, newline and indentation character while keeping the structure intact. The minifier validates as you paste: invalid input surfaces a code-frame error with the line, column and a caret-marked snippet, and an optional lenient repair mode first normalises comments, trailing commas, single quotes and unquoted keys so that not-quite-JSON still compresses cleanly. Each run reports an accurate UTF-8 compression summary — original bytes, minified bytes, bytes saved and the percentage reduction — measured with a real text encoder rather than character counts, so multi-byte characters are weighed correctly. A structure summary breaks down the document by root type, key count, nesting depth and per-type element counts. The minified output streams live and can be copied, downloaded as a .json file, or shared via URL, and nothing is ever uploaded — it all runs locally in your browser.
How to Use
- 1Optionally enable "Repair (lenient)" if your input contains comments, trailing commas, single quotes or unquoted keys.
- 2Paste your JSON into the input panel — the minified result appears live — or click "Load example".
- 3Press "Minify JSON" to validate the input and confirm the compression.
- 4Check the output panel header and Compression section for the byte savings and percentage reduction.
- 5Copy the minified JSON, download it as minified.json, or share it with the generated URL.
Key Benefits
- Removes all optional whitespace to produce the smallest valid JSON
- Accurate UTF-8 byte accounting — original, minified, saved and percent
- Lenient repair handles comments, trailing commas, single quotes and unquoted keys
- Code-frame errors with line, column and a caret-marked snippet for invalid input
- Structure summary: root type, total keys, depth and per-type counts
- Live minification with copy, .json download and shareable URLs
- Runs entirely in the browser — your JSON is never uploaded
Common Use Cases
- Shrinking JSON config or fixtures before embedding them in source or a bundle
- Reducing payload size for an API request body or a data attribute
- Measuring exactly how many bytes whitespace adds to a response
- Compressing JSON5-style hand-written data into strict, minimal JSON
- Preparing a compact one-line JSON value to paste into a shell command or query
Options
Accept comments, trailing commas, single quotes, unquoted keys
0 characters · live
Paste JSON above to minify it live.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- JSON Path FinderFind and test JSON paths
- SVG OptimizerOptimize and compress SVG files
- Railway Config GeneratorBuild railway.json or railway.toml — build/deploy, restart policy, healthcheck, replicas, region, nixpacks — with a format toggle and audit
- JSON FormatterFormat and validate JSON with syntax highlighting
- JSON ValidatorValidate JSON syntax and structure
- YAML to JSONConvert YAML to JSON format
Both the original and minified sizes are measured with a UTF-8 text encoder, so the figures reflect real on-the-wire bytes rather than JavaScript character counts. That means multi-byte characters (accents, emoji, CJK text) are counted accurately, and the percentage saved is computed from those true byte sizes.
Yes, if you enable "Repair (lenient)". That mode accepts comments, trailing commas, single-quoted strings and unquoted keys, normalising the input to valid JSON before minifying. With repair off, such input is reported as invalid.

