๐Ÿ”’ Runs in your browser โ€” nothing is uploadedโœ“ Free, no signup

JSON Minifier

Remove every unnecessary space and line break from JSON to make it as small as possible โ€” and see exactly how many bytes you save.

Loading...

0 characters

Minified JSON

When should you use the JSON Minifier?

  • Shrinking JSON before storing it in a database or cache
  • Putting JSON on a single line for logs, environment variables or curl commands
  • Reducing the size of JSON responses or config files

How to use the JSON Minifier

  1. 1

    Paste JSON

    Paste formatted JSON into the editor, or click Load sample.

  2. 2

    Get the minified result

    It's minified instantly. Invalid JSON shows the error instead.

  3. 3

    Check the savings

    See the size before and after in bytes and the percentage saved.

  4. 4

    Copy or download

    Copy the one-line JSON or download it.

Examples

Formatted JSON to one line

Before

{
  "id": 42,
  "roles": [
    "admin",
    "editor"
  ]
}

After

{"id":42,"roles":["admin","editor"]}

Common errors and how to fix them

Invalid JSON: Unexpected token
The input has a syntax error such as a trailing comma or unquoted key. Use the JSON Formatter's Fix JSON button to repair it, then minify.
Large numbers changed
Integers above 9,007,199,254,740,991 can't be stored exactly in JavaScript. Send very large IDs as strings.
Related tools:ย JSON Formatter ยท JSON Validator ยท JSON Escape / Unescape

More from JSON Tools

Free tools that run in your browser โ€” no signup, nothing uploaded.

JSON Minifier FAQ

It removes all whitespace that isn't inside strings โ€” spaces, tabs and line breaks โ€” so the JSON is as compact as possible. The data stays exactly the same.

It depends on how it was formatted. Indented JSON typically shrinks by 10โ€“30%, and deeply nested JSON more. The tool shows the exact saving.

Yes. Minified JSON is valid JSON and parses to exactly the same data.

Yes. Minifying requires parsing, so invalid JSON shows an error instead of a result.

If your server compresses responses with gzip or Brotli, the extra saving is small but still worthwhile. Minifying matters most for stored data and places where JSON must fit on one line.

No. Minifying happens in your browser.