Minify valid JSON by removing insignificant whitespace between JSON tokens. Create compact, single-line output without changing parsed values or structure, compare character and byte sizes, and copy or download the result directly in your browser.
Parse valid JSON and serialize it without unnecessary whitespace between tokens. The result is usually a compact single-line representation.
The input is parsed before output is generated. Invalid JSON produces an error instead of silently creating an unreliable minified result.
Compare the original and minified character counts or byte sizes, then review the absolute and percentage reduction for the current input.
Copy the compact JSON to your clipboard for API payloads, configuration files, browser storage, test fixtures, or other development workflows.
Download the compact result as a .json file for local storage, deployment assets, testing, or build-related workflows.
Whitespace between JSON tokens is removed, while meaningful spaces inside string values remain part of the data. Keys, values, types, and structure are preserved after parsing.
Paste formatted JSON or open a local .json file if file input is available. The source is parsed in the browser before minification.
Parsing, size calculation, and minification happen in your browser. The page does not require an account or upload the source JSON to a remote service.
Paste formatted or partially compact JSON into the input field, or open a local .json file. Standard JSON syntax is required unless a separate JSONC or JSON5 mode is available.
Click Minify JSON to parse the input and serialize it without insignificant whitespace. If parsing fails, fix the reported syntax error before trying again.
Compare the original and minified character or byte counts. The savings depend on the amount of indentation, spacing, and line breaks in the source.
Copy the compact result or download it as a .json file. Keep a formatted source version for future maintenance and review.
Remove formatting whitespace from valid JSON while preserving the parsed data.
{
"name": "Alice",
"age": 28,
"active": true
}The source contains indentation and line breaks that improve readability but add characters outside the actual JSON values.
{"name":"Alice","age":28,"active":true}The minified result removes insignificant whitespace between JSON tokens. The property names, values, types, and structure remain the same.
Minification is not the same as gzip or Brotli compression. Use an HTTP compression layer when you need network-level compression.
JSON minification removes insignificant whitespace from valid JSON and produces a compact representation. The output commonly appears on one line, but the important property is that whitespace between JSON tokens is removed without changing the parsed data.
A standard minifier parses the input and serializes it again. This is safer than deleting every space character because spaces inside JSON string values are meaningful and must remain unchanged.
It normally removes whitespace between JSON tokens, including indentation, line breaks, and spaces around structural punctuation. For example:
{
"name": "Alice",
"active": true
}can become:
{"name":"Alice","active":true}The space inside a value such as "New York" is not removed because it is part of the string data.
Minification and compression are different operations. Minification changes the JSON text by removing formatting overhead. Network compression such as gzip or Brotli encodes the resulting bytes using a compression algorithm. Many HTTP servers can apply gzip or Brotli automatically even when the source JSON is formatted or minified.
Minification may still be useful for static assets, embedded payloads, storage, or workflows where the raw JSON text itself is transmitted or measured. Do not assume that minification alone provides the same benefit as HTTP compression.
Character count and byte count are not always identical. For ASCII-only JSON they may be similar under common encodings, but non-ASCII text can occupy multiple bytes in UTF-8. A useful size comparison should identify whether it measures JavaScript string length, encoded UTF-8 bytes, or file bytes.
Percentage savings can be calculated as:
savings = (originalSize - minifiedSize) / originalSize × 100Always compare the same measurement unit before interpreting the percentage.
A safe minifier must preserve whitespace and escape sequences inside quoted strings. Consider:
{"message":"Line one\nLine two","title":"New York"}The newline escape and the space inside New York are data. Removing them would change the value and make the operation incorrect.
Standard JSON does not permit comments or trailing commas. JSONC and JSON5 are related formats that add features such as comments, single-quoted strings, or relaxed syntax. A strict JSON minifier should reject those inputs unless it explicitly supports a JSONC or JSON5 parsing mode.
Some specialized minifiers remove comments from JSON-like content, but that is a transformation beyond standard JSON minification. It should be clearly labeled because comments may contain important documentation.
Keep formatted JSON when people need to review or edit it, when it is maintained in version control, or when clear diffs are more valuable than raw text size. A common workflow is to keep a readable source version and generate minified output as a build artifact.
This minifier is designed to parse and serialize JSON in the browser instead of sending the input to a remote service. That is convenient for development data and configuration snippets, but it is not a secret-management system. Avoid entering credentials, tokens, private customer data, or confidential production information into any online tool.
For repeatable builds, use a local formatter, a CI step, or a command-line tool such as jq -c. A production workflow should validate the output, retain a readable source copy, and test the minified file in the target application.