Developer Tools

JSON Minifier

Live

Minify valid JSON and measure the exact byte and character savings before downloading it.

About JSON Minifier

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.

Set up JSON Minifier

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

Complete the fields to prepare a result.

Paste valid JSON text. Use double-quoted property names and string values.

JSON Minifier: minified json

Choose the values that apply, then minify.

Calculation method

Parse the JSON, serialize it with no indentation, and calculate savings as original size minus minified size.

How it works

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.

Examples

Remove formatting whitespace

Example input
{
    "json": "{\n  \"a\": 1\n}"
}
Expected result
{
    "json": "{\"a\":1}",
    "characters_saved": 5
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Frequently asked questions

Does minifying JSON change its values?

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.

Why does the tool parse before minifying?

Parsing verifies that the input follows JSON syntax. Simple whitespace replacement can corrupt spaces inside strings, while parse-and-serialize keeps string contents intact.

Are savings measured in bytes or characters?

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.

Is the JSON uploaded or stored?

No. Parsing, compression, copying, and download creation happen locally in the browser, and UtilityPages does not retain a document history.