# JSON Minifier

Minify JSON by removing every space, tab and line break outside strings while keeping the data exactly as written. Numbers keep their original digits, so large integers and decimals never lose precision, and strings, escapes and key order stay untouched. Invalid JSON is rejected with the line and column of the first error, which suits developers shrinking API payloads, fixtures and config files.

## Frequently asked questions

### What does the JSON minifier remove?

It removes all insignificant whitespace: spaces, tabs and line breaks between tokens. Everything inside strings stays exactly as written, including spaces and escape sequences.

### Can minifying change my numbers?

No. The tool copies each number exactly as written instead of parsing and printing it, so 12345678901234567890 or 1.50 come back unchanged and never lose precision.

### Does it validate the JSON?

Yes. The input must be strict JSON as defined by RFC 8259. Comments, trailing commas, single quotes, unquoted keys and values such as NaN are rejected.

### How are errors reported?

The first problem is reported with its line and column. Typical messages name an unexpected character, an unclosed string, an invalid escape or content after the end of the JSON value.

### Are duplicate keys removed?

No. The minifier does not build an object in memory, so duplicate keys and key order are kept exactly as they appear in the input.

### Is a byte order mark kept?

A leading UTF-8 byte order mark is dropped, because it is not part of the JSON value. Everything else stays in place.

### How deep can the nesting be?

Objects and arrays can be nested up to 1000 levels. Deeper input is rejected with a message rather than risking a slow or failing request.

### How large can the input be?

Up to 1 MB of JSON per request. Minifying runs in a single pass, so even large files return quickly.

### Can I minify JSON Lines or several documents at once?

No. The input must be a single JSON value, such as one object or one array. A second value after the first is reported as unexpected content with its line and column.

### Is my data stored?

No. The JSON is processed in memory for your request and sent back. It is never saved and only request sizes are logged.

Your ad here?

[Email us](mailto:hi@dennn.is?subject=Advertising%20on%20OneClick%20Pro)

[Ad The agent-ready plugin suite for WordPress.](https://sleekwp.com/?ref=oneclickpro)
