JSON Minifier

Minify and compress JSON online by removing all whitespace.

input.json Empty0 lines · 0 B
Ctrl + Enter to format

About the JSON Minifier

The JSON Minifier removes every space, tab and line break that JSON doesn't need, giving you the smallest equivalent text - handy for payloads, config values and anything sent over the network.

🛠️
How to minify JSON
  1. Paste or type your JSON into the editor, or click Import to load a file or URL.
  2. Check the badge: it shows Valid JSON, or Invalid JSON with the error message next to it.
  3. Click Minify to collapse the JSON onto a single line.
  4. The toolbar shows the line count and size, so you can see how much smaller the result is.
  5. Copy the result with the clipboard icon, or use Share to create a link.
  6. Click Format (or press Ctrl + Enter) to turn it back into readable, indented JSON.
💡
Good to know
  • Minifying changes only whitespace: keys, values and their order stay the same.
  • Only valid JSON can be minified. Fix the reported error first - see common JSON errors.
  • The JSON is parsed and written back, so integers beyond JavaScript's safe range (about 16 digits) can lose precision, and a repeated key keeps only its last value.
  • Minified JSON still compresses well with gzip or Brotli. Use both for the smallest transfer size.

Minify JSON Online

Minifying rewrites JSON without the whitespace that only humans need. The data is identical; the text is shorter, so it transfers faster and fits where space is limited.

📐

What minifying changes

  • Removed: indentation, spaces after colons and commas, and every line break between values.
  • Kept: all keys and values, in the same order.
  • Strings are untouched: spaces and line breaks inside a string value are data, so they stay.
  • Nothing is renamed or dropped: unlike JavaScript minifiers, a JSON minifier never shortens names.
📦

Common reasons to minify JSON

  • Shrinking API request and response bodies
  • Fitting JSON into an environment variable or a single config line
  • Embedding JSON in HTML, a URL parameter or a script
  • Reducing the size of JSON stored in a database or cache

JSON Minifier FAQ

How much smaller does minified JSON get?

It depends on how the original was formatted: deeply nested JSON with wide indentation shrinks the most, and JSON that was already compact barely changes. The toolbar shows the size before and after.

Is minified JSON still valid?

Yes. Whitespace between values has no meaning in JSON, so every parser reads the minified and the formatted version as the same data.

What is the difference between minifying and compressing?

Minifying removes characters and leaves ordinary JSON text. Compression such as gzip or Brotli encodes the text into a smaller binary form that must be decompressed before use. They work well together.

How do I make minified JSON readable again?

Click Format, or use the JSON Formatter. Formatting restores indentation without changing the data.