Skip to content
Tooletto

JSON Minifier

A preset of JSON Formatter

Strip every unnecessary space, tab and line break from JSON to produce the smallest valid output. Useful for embedding JSON in environment variables, query strings or config files where size matters.

  • Files never leave your device
  • Free, no signup
  • No watermarks
  • Works offline once loaded
Loading tool…

How to json formatter

  1. 1

    Paste your JSON

    Paste or type JSON into the input box. It is parsed as you type.

  2. 2

    Choose a style

    Pick 2-space, 4-space or tab indentation, or switch to minified output.

  3. 3

    Copy the result

    Copy the formatted JSON to your clipboard or download it as a .json file.

Where minified JSON actually saves something that matters

The size difference between formatted and minified JSON scales with how deeply nested the structure is, since every level of indentation adds whitespace at every line — a deeply nested API response can carry a genuinely meaningful fraction of its total byte count as pure formatting whitespace, none of which the receiving program reads or needs. Stripping it before the data goes into an HTTP request body, a URL query parameter with a length limit, or an environment variable directly reduces the payload for no cost to the data itself.

It matters less where the constraint is not size but readability — a config file checked into source control benefits far more from staying formatted, since a minified single-line JSON file is difficult for a human reviewer to diff or edit, and version control tools generally handle line-based diffs far better than they handle single dense lines.

Minifying does not change what the data means

It is worth being explicit that minification is purely a whitespace operation — no keys, values, types or structure change in any way, and a program parsing the minified output receives an object identical in every respect to what it would receive from the formatted version. The only observable difference is the byte count of the text representation, never the data it represents.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting use the browser's built-in JSON engine. Nothing is transmitted, logged or stored, which makes it safe for API responses containing production data.

Why does it say my JSON is invalid?

The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys, and comments — none of which are valid JSON even though JavaScript accepts them. The error message points at the exact position.

What is the difference between formatting and minifying?

Formatting adds indentation and line breaks so the structure is readable. Minifying removes every optional character to make the payload as small as possible, which is what you want when embedding JSON in a request or a config file.

Can it handle very large files?

Documents up to a few megabytes format instantly. Beyond roughly 10 MB the browser's own JSON parser becomes the bottleneck regardless of the tool used.