JSON Minifier
Minify JSON by removing whitespace and formatting.
How to Use JSON Minifier
Paste your formatted JSON into the input box, or load it from a .json file on disk.
Optionally enable the setting that keeps a trailing newline, otherwise the output is one continuous line.
Click the "Process" button to strip all insignificant whitespace outside of JSON strings.
Copy the minified output or download it, and check the size savings reported below the result.
Features
Frequently Asked Questions
Related Tools
JSON Formatter
Format and beautify JSON data with proper indentation.
JSON Validator
Validate JSON data and find syntax errors.
HTML Formatter
Format and beautify HTML code.
HTML Minifier
Minify HTML code to reduce file size.
CSS Formatter
Format and beautify CSS code.
CSS Minifier
Minify CSS code for production.
About JSON Minifier
Whitespace inside a JSON document is pure overhead once the data has been parsed, yet pretty-printed files are often shipped straight to a CDN. The JSON Minifier strips every space, newline, and indent character that sits outside of a string value, collapsing the whole document into a single line. Typical results are a 30 to 60 percent reduction before compression even kicks in.
The important detail is what it leaves alone. Whitespace that appears inside quoted strings is content, not formatting, so spaces in "New York" and newlines inside a description survive untouched. String escapes, unicode sequences, and numeric literals are all preserved exactly as parsed.
Invalid JSON is rejected rather than silently mangled. That means a minified file that still parses is a file you can trust, which is the difference between this and a naive find-and-replace over whitespace characters. Pair it with gzip or Brotli on your server for the full win.
When to Use This Tool
- Shrinking API payloads before sending them to constrained mobile clients
- Embedding JSON inside a script tag, a serverless function, or a template file
- Comparing two payloads byte-for-byte after removing formatting differences
- Producing a content hash or fingerprint from a JSON document for cache busting
- Reducing storage for configuration blobs and test fixtures in a repository