developer-tools
JSON Minifier
Minify JSON online by validating it first, then removing unnecessary whitespace, line breaks, and indentation.
Tool workspace
The interactive tool requires JavaScript.
Instructions
2. Click “Minify JSON” so the tool validates the syntax before producing a compact result.
3. Review the output against your target system before copying it into a request body, config value, or document.
Paste valid JSON and generate a compact result for request bodies, config snippets, logs, and documentation examples. The current tool code performs parsing and serialization in your browser.
JSON Minifier runs JSON.parse and then JSON.stringify. That validates standard JSON and removes layout whitespace, but it is not a byte-preserving transform: duplicate keys keep the last value, large or non-finite numeric results can change, negative zero becomes zero, and integer-like object keys can be reordered.
When JSON minifying helps
Minifying is useful when valid JSON contains extra line breaks, indentation, or layout whitespace. It creates shorter text for request bodies, config values, command-line examples, documentation snippets, or one-line logs. It is not encryption, redaction, or business-rule validation.
Why validation comes first
A plain string cleanup can damage spaces inside strings or make invalid input look successful. This tool parses JSON first and only serializes the result when parsing succeeds, so the minified output remains valid JSON.
What changes after minifying
Parsing and serialization can change more than layout. For example, 9007199254740993 becomes 9007199254740992 in JavaScript Number, 1e400 serializes as null, -0 becomes 0, 1.2300 becomes 1.23, duplicate keys keep the last value, and integer-like keys can move. Do not use this transform when signatures, hashes, exact bytes, numeric lexemes, or source key order matter.