JSON
Minified JSON
Empty Runs in your browser

JSON Minifier - Minify and Compress JSON Online

Paste formatted JSON and get the smallest valid version on one line, ready to embed in code, send in a request or store. The status line shows the size before and after.

How to minify JSON

  1. Paste formatted JSON into the left editor, or open or drop a .json file.
  2. The minified JSON appears on the right, on a single line. The status line shows the size before and after, and how much smaller it is.
  3. Copy the result or download it as a .json file.

What minifying removes

Minifying removes every space, tab and line break that sits between values. It does not touch the data itself: strings, numbers, keys and their order stay exactly as they were, and spaces inside strings are kept. The output parses to the same value as the input.

The input has to be valid JSON. If it is not, the error is shown with its line and column. For input with comments, trailing commas or single quotes, run it through the JSON Repair tool first.

Why minify JSON?

If you are serving JSON over HTTP, gzip or Brotli compression saves even more, and works well together with minifying.

Example

{
  "name": "online-json",
  "tools": [ "formatter", "minifier" ]
}

becomes {"name":"online-json","tools":["formatter","minifier"]}.

To make minified JSON readable again, paste it into the JSON Beautifier.

Private by design

Minifying happens in your browser. Your JSON is never uploaded.

Frequently asked questions

What does minifying JSON do?

It removes every space, tab and line break between values, so the JSON fits on one line and takes fewer bytes. The data itself does not change.

How much smaller does minified JSON get?

It depends on the indentation. Pretty printed JSON often shrinks by 20 to 40 percent. The status line shows the exact size before and after.

Is minified JSON still valid?

Yes. Whitespace between values is optional in JSON, so minified JSON parses to exactly the same data.

Can I minify JSON with comments?

Comments are not valid JSON. Press Fix JSON in the status line to remove them, then minify the result.

How do I make minified JSON readable again?

Paste it into the JSON Beautifier or the JSON Formatter to add indentation back.

Editor settings

Type

{
  "id": 1024, "name": "Ada", "active": true,
  "tags": ["0O", "1lI", "=> != >="], "manager": null
}

Colour theme

Code editor

Defaults

Send feedback

How is online-json working for you?