JSON Minifier
Minify JSON online by removing all unnecessary whitespace, and see how many bytes you saved. Invalid JSON is reported with its line and column.
Runs in your browser · Nothing uploadedFree · No sign-up
Something not working, or missing a feature? Send feedback
About the JSON Minifier
Minified JSON is smaller to store and send. The JSON Minifier removes every unnecessary space and line break and shows how many bytes you saved.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the JSON Minifier
- Paste JSON or open a file.
- Check the size saved shown below the output.
- Copy or download the minified JSON.
Example
Input
{
"name": "devtoolry",
"version": "1.4.0",
"features": ["formatters", "compilers"],
"limits": { "maxUploadMb": 10, "timeoutMs": 5000 }
}Result
{"name":"devtoolry","version":"1.4.0","features":["formatters","compilers"],"limits":{"maxUploadMb":10,"timeoutMs":5000}}Spaces and line breaks between tokens are removed; spaces inside strings are kept.
Common mistakes
- Minifying JSON with comments. JSONC files such as tsconfig.json may contain comments, which standard JSON does not allow. Remove the comments first or the minifier reports a syntax error.
- Expecting a big saving after compression. Servers usually gzip or Brotli-compress JSON, which already removes most of the whitespace cost. Minify for storage, embedding and size-limited fields.
- Large integer IDs. Numbers above 2^53 lose precision when parsed in JavaScript, so 12345678901234567890 comes out changed. Store such IDs as strings.
Works well with the JSON Minifier
- JSON Formatter: make minified JSON readable again.
- JSON Validator: find a syntax error before minifying.
- Base64 Encode / Decode: encode the minified JSON for a header or URL.
Frequently asked questions
Is minified JSON still valid?
Yes. Only whitespace outside strings is removed; the data is identical.
Should I minify JSON for APIs?
Servers usually compress responses with gzip or Brotli, which removes most of the whitespace cost, but minifying still helps for stored or embedded JSON.
Does it change key order?
No. Keys stay in the order you wrote them. Duplicate keys are reduced to the last value, as every JSON parser does.
Is my data uploaded?
No. Minification uses your browser’s JSON parser, so the data never leaves your device.
Related tools
HTML Minifier
Minify HTML online: remove comments and collapse whitespace while keeping pre, textarea, script and style blocks intact. See the size saved instantly.
CSS Minifier
Minify CSS online: strip comments, whitespace and redundant semicolons to shrink your stylesheet, and see the bytes saved. Runs in your browser.
JavaScript Minifier
Minify and mangle JavaScript online with Terser for smaller bundles. Supports modern ES syntax, with compress and mangle options and the size saved.
XML Minifier
Minify XML online by removing whitespace between tags, with an option to keep comments. Malformed XML is reported with its location.
SQL Minifier
Compress SQL queries onto a single line online, removing comments and redundant whitespace. Useful for logs, config files and embedding SQL in code.
JSON Formatter
Format and beautify JSON with configurable indentation and optional key sorting. Errors are reported with exact line and column.