Remove formatting whitespace
{
"json": "{\n \"a\": 1\n}"
}
{
"json": "{\"a\":1}",
"characters_saved": 5
}
Developer Tools
Minify valid JSON and measure the exact byte and character savings before downloading it.
Published Last reviewed
Compress formatted JSON by removing indentation, spaces between tokens, and line breaks that are not part of string values. The comparison dashboard shows original size, minified size, bytes saved, and the percentage reduction. Copy the compact result or download it as minified.json. The document is parsed before compression, so invalid syntax is reported instead of producing damaged output, and all processing stays in the browser.
Workspace
Edit the source fields below and inspect the rendered output alongside your work.
Complete the fields to prepare a result.
Choose the values that apply, then minify.
Parse the JSON, serialize it with no indentation, and calculate savings as original size minus minified size.
The tool parses the input with JSON.parse and serializes the resulting value with JSON.stringify without indentation. This removes insignificant formatting whitespace while preserving strings, numbers, booleans, null values, object members, and array order. Size figures use UTF-8 bytes; the API also reports characters removed.
{
"json": "{\n \"a\": 1\n}"
}
{
"json": "{\"a\":1}",
"characters_saved": 5
}
This tool does not store your inputs or results on UtilityPages.org.
No. It removes formatting whitespace outside string values. Parsed values and array order remain the same, although insignificant numeric formatting such as trailing decimal zeros may be normalized by serialization.
Parsing verifies that the input follows JSON syntax. Simple whitespace replacement can corrupt spaces inside strings, while parse-and-serialize keeps string contents intact.
The on-page size comparison uses UTF-8 bytes, which reflects file size. The execution response also reports the number of JavaScript characters removed. These figures can differ for non-ASCII text.
No. Parsing, compression, copying, and download creation happen locally in the browser, and UtilityPages does not retain a document history.