JSON Minifier
Remove every optional space and line break from JSON to make it as small as possible, without changing a single value.
JSON Minifier: the tool
Input
Minified JSON
The result appears here.How to use JSON Minifier
- Paste formatted or pretty-printed JSON into the left panel.
- The minified result appears on the right. The status bar shows the size before and after.
- Copy it, or download it as a .json file. Use Use as input to chain it into another step.
- If the JSON is invalid, nothing is minified and the error is shown with its line and column.
Example
A formatted document and its minified form. Only whitespace is removed.
{
"name": "codevory",
"tools": [
"json",
"yaml"
],
"private": true,
"owner": null
}{"name":"codevory","tools":["json","yaml"],"private":true,"owner":null}About this tool
Minifying removes the whitespace that JSON allows between tokens: indentation, line breaks and the space after colons and commas. The data is unchanged. Typical pretty-printed documents shrink by 20 to 40 percent, more when they are deeply nested.
This tool does not parse numbers into JavaScript doubles, so a 20-digit identifier or a number such as 1.10 comes out exactly as it went in. Strings and escape sequences are untouched, and key order is preserved.
Minified JSON is the right form for payloads, storage and URLs, and pretty-printed JSON is the right form for people. For network transfer, also enable gzip or Brotli on your server: it compresses the repetition that minification cannot remove.
Frequently asked questions
Does minifying JSON change the data?
No. Only whitespace outside of strings is removed. Values, key order and the exact text of numbers and strings are preserved, including very large integers.
How much smaller will my JSON get?
It depends on how it was indented. Documents with deep nesting and short values save the most, often a third or more. The status bar shows the exact before and after sizes.
Is minification the same as compression?
No. Minification removes unneeded characters and the result is still plain JSON. Compression such as gzip encodes the data in a binary form that must be decompressed. They work well together.
Can minified JSON be turned back into readable JSON?
Yes, with the JSON formatter. Comments never existed in JSON, so nothing is lost in either direction.
What if my JSON has comments or trailing commas?
It is not valid JSON, so it cannot be minified safely. The error message identifies the comment or comma so that you can remove it first.
More developer tools
- { }JSON Formatter & ValidatorFormat, validate and minify JSON. Errors point to the exact line and column, and nothing you paste leaves your browser.
- ok?JSON ValidatorCheck JSON against the specification and get the exact line and column of the first error, plus a summary of what the document contains.
- →csvJSON to CSV ConverterConvert a JSON array of objects to CSV. Nested objects and arrays are spread into columns, and every cell is quoted correctly.
- cssCSS MinifierRemove comments, whitespace and the last semicolon of every block from CSS. The result behaves exactly like the original.