JSON Minifier

Minify JSON by removing whitespace, in your browser. Validates first, keeps strings and numbers exactly as written, and never uploads your data.

Independently verified for accuracy

Calculator by Toolsloft ↗

Paste formatted JSON and this tool strips out the spaces, tabs, and line breaks to give you the smallest valid version. Minified JSON is what you want for API payloads, config values, and anywhere byte size matters. It runs in your browser, so your data is never uploaded.

How this is calculated

The tool first parses the input to confirm it is valid JSON, then removes every space, tab, carriage return, and newline that falls outside a string literal, following the whitespace rules in the JSON standard (RFC 8259). Text inside quotes and the exact form of each number are kept as written, so nothing about the data changes except its size.

How to use

  1. Paste your formatted JSON into the input box.
  2. The minified JSON appears instantly in the output box.
  3. Copy the result, or fix the reported error if the JSON is invalid.

Examples

  • Minify: { "a": 1, "b": [1, 2] } → {"a":1,"b":[1,2]}

FAQ

Does minifying change my numbers?
No. This tool only removes whitespace outside of strings. A value written as 1.50 stays 1.50 and 1e3 stays 1e3, because it does not re-serialize your data the way a parse-and-print tool would.
What happens if my JSON is invalid?
The tool validates the input first. If it is not valid JSON, you get an error instead of a result, so you never end up with broken minified output.
Is the whitespace inside my strings removed too?
No. Only whitespace between tokens is removed. Spaces, tabs, and newlines inside quoted strings are part of the data and are left exactly as they are.

Embed this calculator

Add this free calculator to your own site. Copy the code and paste it where you want it to appear.