JSON Minifier
Minify JSON without rounding large numbers or rewriting values. Beautify with 2 or 4-space indentation, or validate syntax with error details. Numbers, string escapes and key order stay as written. Live byte counts show the size change. Free, no sign-up; formatting runs in your browser.
The tool validates JSON syntax, then changes only whitespace outside strings. Your pasted text is processed locally.
Minify and Beautify preserve original values, string escapes, key order and duplicate keys.
Why minify JSON?
JSON is the default format for API responses, webhook payloads, config files and fixture data, and a great deal of it travels with generous indentation that no parser needs. Minifying removes newlines, indentation and the spaces around colons, commas and braces, typically shrinking a pretty-printed payload by 15 to 40 percent. On a busy endpoint that saving multiplies across every request: smaller responses mean lower bandwidth bills, faster time-to-first-byte on slow connections and quicker mobile startup. This JSON minifier shows input size, output size and the exact percentage saved as you type, so you can measure the win on your own payloads instead of guessing. The tool first checks JSON syntax, then removes only JSON whitespace outside strings. It copies the original number and string tokens instead of converting values back from JavaScript, so large IDs, decimal spellings and escaped characters stay as written.
Beautify and validate when humans need to read it
The same engine works in the other direction: paste a minified API response and Beautify expands it with 2 or 4-space indentation so nested objects and arrays are easy to scan. Validate only mode reports whether the document parses without rewriting it at all. When JSON.parse rejects your input, you get the parser's own message and, where the browser provides it, the exact character position converted into a line and column. That pinpoints the usual suspects: trailing commas, single-quoted strings, unquoted keys, comments (JSON has none) and stray text outside the document.
How to use this JSON minifier
Paste JSON into the input box, click Load example for a sample nested document, or upload a .json file (it is read locally, never sent anywhere). Pick Minify, Beautify or Validate only, choose an indent width for beautify, and the output updates instantly with validation status and byte counts. Then copy the result or download it as a .json file. Formatting runs locally and keeps working offline after the page loads. Available browser memory is the practical limit for large documents; try a smaller file if a very large paste makes the page slow.
Frequently asked questions
What does JSON minification do?
JSON minification removes spaces, tabs and line breaks outside strings. It keeps every original key, value and string escape as written, including large numbers and duplicate keys. The tool validates JSON syntax before changing the layout.
How much smaller does minified JSON get?
Pretty-printed JSON typically shrinks by 15 to 40 percent when minified, depending on how deeply it is indented and how much whitespace it carries. The tool shows input size, output size and the exact percentage saved, so you can measure the effect on your own API responses, config files or fixture data rather than guessing.
Why does my JSON fail to validate?
The most common causes are trailing commas after the last item, single-quoted strings, unquoted keys, comments (JSON has none), and stray text before or after the document. When JSON.parse rejects your input, this tool shows the parser's message and, where the browser reports it, the exact character position converted into a line and column so you can jump straight to the problem.
Will large numbers or decimal values change?
No. Minify and Beautify copy original number tokens, including integers beyond JavaScript’s safe integer range, trailing decimal zeroes and exponent notation. They also retain string escapes, key order and duplicate keys. Formatting changes whitespace outside strings only.
Is my JSON uploaded anywhere?
No. Validation and formatting run locally in your browser. The tool checks syntax, then copies the original tokens while changing whitespace outside strings. It does not upload your JSON, and formatting keeps working offline after the page loads.