JSON Minifier
Remove whitespace and compress JSON to reduce file size. Also validates your JSON syntax.
Frequently Asked Questions
About this calculator
Remove whitespace from JSON to shrink it for APIs, config files and storage, while checking that it is valid. Paste, press Minify JSON, and copy.
Typical savings are 20 to 40% for pretty-printed data, and more with deep indentation.
How to use it
- Paste your JSON.
- Press Minify JSON.
- Press Copy.
How it works
JSON has six value types: object {}, array [], string, number, true/false and null. Keys and strings need double quotes, there are no trailing commas, no comments and no single quotes. The formatter parses your text; if it parses, it re-prints it with indentation (or with all whitespace removed when minifying). If not, the error shows where the problem is.
Worked example
Input {"name":"Asha","age":30,"skills":["js","sql"]}
| Formatted | Each key on its own line, indented two spaces |
| Minified | {"name":"Asha","age":30,"skills":["js","sql"]} |
Runs entirely in your browser. Nothing you paste is uploaded.
Tips and common mistakes
- Most JSON errors are trailing commas, single quotes or unquoted keys.
- Minify JSON for production payloads and format it for reading.
- Large numbers beyond 2⁵³ lose precision in JavaScript.
- JSON has no comments; use a separate field if you need notes.
- Validate API responses before parsing in code.
Frequently asked questions
What is JSON?
A text format for structured data, based on JavaScript object syntax.
Why does my JSON fail to parse?
Usually a trailing comma, single quotes or missing quote marks.
What does minify do?
Removes all unneeded whitespace.
Can JSON have comments?
No.
What is the difference between JSON and a JavaScript object?
JSON is stricter: double quotes only, no functions or undefined.
Is my data sent to a server?
No.