JSON Minifier
Squeeze JSON onto a single line and see how many bytes you save.
How to use the JSON Minifier
- Paste your JSON, open a .json file, or drop one onto the left panel.
- The minified version appears on the right straight away. Compare the character counts under each panel to see the saving.
- If the JSON is broken, the error shows the exact line and column to fix.
- Copy the single-line result or download it as a .json file.
Examples
About this tool
Indentation and line breaks make JSON pleasant to read, but every one of those characters still has to travel over the network and sit in storage. Minifying removes all whitespace that sits outside of string values, so the data stays exactly the same while the text gets smaller. On deeply nested files the reduction is often 20-40%.
Because the tool fully parses your input before writing it back out, it doubles as a validator: you only ever get valid JSON out. With the forgiving option switched on, // and /* */ comments plus trailing commas are removed too, which is useful when you want to ship a hand-edited config file to a strict parser.
Tip: minified JSON is ideal for embedding in an environment variable, a URL-safe payload or a database column. Keep the formatted copy in version control so changes stay easy to review.
Frequently asked questions
Does minifying change my data?
No. Only whitespace between tokens is removed. Keys, values, order and spaces inside strings stay exactly as they were. Sorting keys is optional and off by default.
How much smaller will my JSON get?
It depends on how it was formatted. A file indented with 4 spaces and lots of nesting can shrink by a third or more; JSON that is already compact will barely change. Compare the character counts shown under the two panels.
Is my JSON uploaded anywhere?
No. Parsing and minifying run in your browser tab, so tokens, customer records or internal configs never leave your computer.
Can I minify JSON with comments?
Yes. Keep "Forgive trailing commas & comments" on and comments are stripped before parsing. The output is plain, standards-compliant JSON.
How do I turn it back into readable JSON?
Paste the minified text into the JSON Formatter, which re-indents it with 2 spaces, 4 spaces or tabs.