JSON Input

Minified Output

What Is a JSON Minifier?

Every kilobyte matters when you're shipping API responses over mobile networks or trying to keep your app's config files lean. Minified JSON strips out all the whitespace — no indentation, no newlines, no spaces between keys and values — leaving a single compact line. JSON allows any amount of whitespace by spec, so the minified version is just as valid as the pretty-printed one. The difference can be meaningful: a formatted response with 2-space indentation can shrink 30–50% once minified. See RFC 8259 for the formal rules.

This tool runs in your browser. Your JSON is passed through JSON.stringify() with no extra arguments, which produces the minimal output. Nothing is sent to a server.

How to Use This Tool

1

Paste or Upload

Paste your JSON into the left editor or click Upload to load a file. The Sample button loads example data.

2

View Minified Output

The right panel shows the minified result automatically. The stats bar displays original size, minified size, and how much was saved. Invalid JSON will show an error.

3

Copy or Download

Use Copy or Download to get the minified JSON. If you need formatted output again, use the JSON Formatter first. For validating syntax before or after minifying, the JSON Validator handles that.

JSON Minification Examples

Minification removes all whitespace. Here are telecom-themed examples:

Formatted input

Input

Minified output

Output

When Minified JSON Is Used

API responses are often minified to reduce bandwidth. When you're building an API, you might minify the JSON you send. When storing JSON in a database column or a URL parameter, the smaller size matters. Build tools and bundlers sometimes expect minified config. The JSON spec allows any amount of whitespace, so minified JSON is still valid.

If you need to read minified JSON, paste it into the JSON Formatter first. For validating syntax before or after minifying, the JSON Validator handles that.

Frequently Asked Questions

How do I minify JSON in JavaScript?

Call JSON.stringify(obj) without the optional spacing argument. That's literally all this tool does — it parses your input then calls JSON.stringify() with no extras. No server involved.

What's the difference between minified and formatted JSON?

Formatted (pretty-printed) JSON has indentation and newlines to make it human-readable. Minified JSON has all of that stripped out — same data, just no whitespace. RFC 8259 says whitespace is insignificant, so both are equally valid. Formatted JSON is easier to read and debug; minified JSON is smaller to send over a network.

How much smaller does minified JSON get?

It depends on how much whitespace was in the original. Formatted JSON with 2-space indentation typically shrinks 30–50%. The stats bar on this page shows the exact before/after sizes so you can see the savings.

Can I minify invalid JSON?

No. The tool parses the input first. If it's not valid JSON, you'll see an error. Fix the syntax first using the JSON Validator or JSON Formatter.

Does minifying change the actual data?

No — only whitespace is removed. All keys, values, arrays, and nested objects stay exactly the same. The output is semantically identical to the input.

Related Tools

For more on JSON, see MDN's JSON guide, the RFC 8259 specification, and json.org. For JSON.stringify, see MDN. For command-line minification of large files, see jq. See also Postman for API testing.