Skip to main content

Minify JSON to reduce its size

Minifying parses the JSON and writes it back without indentation, line breaks, or spaces between tokens. The data is unchanged, so the result is simply smaller to store and send.

Worked example

Input
{
  "order": 1042,
  "customer": "Ada Lovelace",
  "items": [
    { "sku": "NB-01", "qty": 2, "price": 12.50 },
    { "sku": "PEN-7", "qty": 10, "price": 1.25 }
  ],
  "paid": true
}
Output
{"order":1042,"customer":"Ada Lovelace","items":[{"sku":"NB-01","qty":2,"price":12.5},{"sku":"PEN-7","qty":10,"price":1.25}],"paid":true}
Bytes before
182
Bytes after
137
Saved
24.7%

Rules the formatter follows

  • Whitespace between tokens is removed; spaces inside string values are kept.
  • Numbers are rewritten in their shortest form, for example 12.50 becomes 12.5.
  • Key order is preserved, and if a key appears twice only its last value remains.