JSON Minifier (Compress JSON Online)

JSON Formatter →Developer Tools

Paste JSON and get it on one line with every unnecessary space and line break removed, plus how many bytes you saved.

Options
Input
Output

Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy

About

What the JSON Minifier does

The JSON Minifier removes every space, tab and line break that sits outside a string, so a formatted document becomes a single line with exactly the same data. The status line shows the size before and after and the percentage saved. Invalid JSON is not minified; you get the line and column of the problem instead.

Steps

How to use it

  1. 1Paste your JSON or open the page from a link with ?json= in it.
  2. 2Press Minify, or Cmd+Enter / Ctrl+Enter.
  3. 3Check the size saved in the status line, then copy or download the result.

Example

A real run

Input

{
  "name": "storefront",
  "port": 8080,
  "debug": false,
  "database": {
    "host": "db.internal",
    "pool": 10
  },
  "features": [
    "search",
    "reviews"
  ]
}

Output

{"name":"storefront","port":8080,"debug":false,"database":{"host":"db.internal","pool":10},"features":["search","reviews"]}

172 B → 123 B · 28.5% smaller

The formatted config shrinks by 49 bytes, about 28%, because only indentation and line breaks are removed; every key and value is unchanged.

Options

Every setting, and when to use it

Minify
Parses the document and writes it back with no whitespace between tokens. Strings are untouched, so a space inside "New York" stays.
Format
Does the opposite with the chosen indent, for when a minified payload needs to be read. Use the JSON Formatter page for formatting-first work.
Share link
Copies a link that reopens this page with your JSON minified. The JSON is carried inside the link after the # sign and is not stored on our server for sharing.

Good to know

Common problems and limits

The limit is your browser's memory rather than a fixed size; documents of tens of megabytes minify in well under a second on a laptop.

Minifying never changes values, key order or number formatting such as 1.50; it only removes whitespace. Comments are not valid JSON, so a file with // comments shows an error with its position.

A copy of each run is kept in your past runs, limited to the first 512 KB of input and output.

Audience

Who uses it

  • API developersShrink a request body or fixture before pasting it into curl, Postman or an environment variable that must be one line.
  • Front-end developersInline a small config or translation object in HTML or a data attribute without the line breaks.
  • DevOps engineersPut a JSON policy or secret template into a single-line field in CI settings or a Kubernetes manifest.

FAQ

Frequently asked

What does minifying JSON mean?

Removing the whitespace that only exists for humans: indentation, line breaks and spaces after colons and commas. The result is one line that any JSON parser reads exactly the same way as the formatted original.

Does minifying change my data?

No. Only whitespace outside strings is removed. Keys, values, their order and the text inside strings are kept exactly, which you can confirm by comparing both versions in JSON Compare.

Is minifying worth it if my server uses gzip?

Usually only a little. Gzip and Brotli already compress repeated whitespace very well, so minifying before compression saves a few extra percent. It matters more where nothing is compressed: environment variables, single-line config fields, logs and database columns.

How big is too big for JSON?

The format has no size limit, but tools do. Express's built-in JSON body parser rejects bodies over 100 KB unless you raise its limit, and many APIs cap requests at a few megabytes. For data in the hundreds of megabytes, JSON Lines or a binary format is easier to stream.

How do I minify JSON in VS Code?

VS Code has no built-in minify command. Select the text and use Join Lines (Ctrl+J on Windows and Linux) for a rough result, install a JSON tools extension, or paste the text here. On the command line, jq -c . file.json prints it minified.

Why do I get an error instead of minified output?

The input is not valid JSON, so it cannot be safely rewritten. The error gives the line and column; common causes are trailing commas, single quotes and comments. The JSON Validator can repair most of these automatically.

Automation: an MCP tool format_json(json, minify: true) → json and an n8n node are planned for this tool.

GuideJSON, YAML, TOML and XML: which format when →When to use JSON, YAML, TOML or XML: what each is good at, the traps (YAML's no, JSON's big numbers, XML attributes) and how to convert between them.
Built and maintained by Radhika SinghLast updated Questions: hello@operativez.ai