Skip to tools

Minifiers

JSON Minifier

Pretty-printed JSON is great for people but wasteful on the wire. The JSON Minifier validates your input and removes every unnecessary space and line break, producing the smallest valid representation of the same data.

Smaller payloads mean faster API responses, lighter localStorage entries and compact fixtures for tests.

How to use the JSON Minifier

  1. 1Use the JSON Minifier right on this page, or open the full workspace for history, sharing and every other tool.
  2. 2Paste your input, upload a file, or drag and drop a file onto the input box (up to 25 MB).
  3. 3The result appears in the output panel automatically and updates when you change the input or an option.
  4. 4Use Copy Output or Download to save the result. Nothing is uploaded to a server.

Example

A multi-line object becomes a single compact line with no spaces between tokens.

Input
{
  "a": 1,
  "b": [1, 2, 3]
}
Output
{"a":1,"b":[1,2,3]}

When to use it

  • Shrinking JSON fixtures or mock responses stored in a repository
  • Preparing a JSON value to paste into an environment variable or a single-line config
  • Reducing payload size before sending data to an API

Tips and common mistakes

  • Minifying also validates — invalid JSON is reported instead of silently passed through.
  • Spaces inside string values are kept; only formatting whitespace is removed.
  • Use the JSON Formatter to expand it again whenever you need to read it.

Frequently asked questions

Is minified JSON still valid?

Yes. It is exactly the same data, just without formatting whitespace. Numbers are copied as written, so large IDs are never rounded.

How much smaller will my file get?

Typically 10–30% for indented JSON, depending on nesting depth and indentation size.

TutorialWhat is JSON? A quick primer for developers

Related tools

Ready to try it?

Free, no sign-up, and your data never leaves your browser.