← All tools/Minifiers/Code/JSON Minifier
JSON Minifier
Paste pretty JSON and get compact minified JSON back, with bytes saved and a copy button.
Bytes saved
How it works
minified = JSON.stringify(JSON.parse(input)) All spaces, line breaks and indentation outside strings are removed. Nothing inside a string value is changed.
Worked example: the pretty JSON with a on one line and b on the next, 22 bytes in total, minifies to {“a”:1,“b”:2} — 13 bytes — saving 9 bytes. The meaning is unchanged; only the whitespace is gone.
Frequently asked questions
Does minifying change my data?
No. It removes only whitespace outside strings, so the parsed values are exactly the same as before.
What happens with invalid JSON?
The page says the JSON is invalid and shows the error message, without clearing your input, so you can fix it and try again.
Are strings inside the JSON left alone?
Yes. Spaces inside a quoted string are part of the value, so they are kept exactly as you typed them.
Does my JSON leave this page?
No. The minifying runs entirely in your browser, and nothing is sent anywhere.
More tools
Tell us what you think
Loving this tool, or stuck on something? Tell us — it takes a minute.
We’ll only use your name and email to reply if needed. The tool and page are filled in for you.