How to minify JSON
- Paste your JSON into Input, drop a
.jsonfile on the page, or press Open file. - The result appears on one line as you type. Turn on Sort keys if you want a stable order.
- Select Copy to put it on your clipboard, or Download to save
minified.json.
The status bar shows the size of the result. If the input is not valid JSON, you see the line and column of the problem instead of a result.
What minifying does
JSON allows spaces, tabs and line breaks between its tokens. They help people read the file and mean nothing to a parser. Minifying removes all of them, so { "a": 1, "b": [ 1, 2 ] } becomes {"a":1,"b":[1,2]}. Spaces inside strings are never touched, because they are part of the data.
When to minify
- Smaller payloads. Less to send in API responses, config bundles and local storage entries.
- One-line values. Environment variables, query parameters and test fixtures often need JSON on a single line.
- Stable diffs. Combined with Sort keys, two files with the same data produce the same text, which makes comparing easy with the JSON compare tool.
Tips
- Check syntax first with the JSON validator if you only need a yes or no.
- Need to read the result again? Use the JSON formatter and choose an indent.
- Escape sequences such as
\nandéinside strings stay as written, so the data is not altered. - Very large files are processed in a background thread, so the page stays responsive.
- Keep a pretty-printed copy in version control for people to read, and minify only the copy you ship or paste into a single-line setting.
Privacy
API payloads often contain tokens or customer records. This tool never sends your text anywhere, and nothing is stored or logged.