Skip to content
Input
Text
Limit
1 MiB
Runtime
Browser

Minify JSON into a compact, valid document

Remove insignificant whitespace from valid JSON for a compact fixture, request example, or transport artifact while keeping values unchanged.

Local processingNo sign-upNo share URL

Minify JSON

Inputs are limited to 1 MiB and stay in this browser tab.

Paste or edit the source. Tool Swim does not upload or save it.

Minified JSON

Nothing is placed in a URL, account, or remote log.

What this tool does

Strict, bounded, local processing

Minification parses first and serializes once. It is not compression, schema validation, or a repair pass for comments and trailing commas.

Minification removes whitespace that JSON does not need

Spaces, tabs, and line breaks can separate JSON tokens without changing the represented value. A minifier parses the document and writes one compact serialization, removing that optional spacing. Strings keep the whitespace inside their quotes because those characters are data, not formatting.

The result can be smaller than a pretty-printed fixture and convenient for a request body or environment value. It is still plain text. Network compression such as Brotli or gzip works at a different layer and usually saves far more bytes on repeated keys and values.

Compact output is harder to review and merge

A one-line document hides nesting and produces noisy version-control diffs. Keep a readable source when humans are expected to edit or approve the data, and minify only the generated artifact when a consumer requires compact text. Do not replace a maintainable configuration file solely to save a small amount of repository space.

If two compact responses need comparison, parse them structurally with the compare tool. Line-based comparison treats the entire one-line payload as changed and cannot distinguish an added member from a formatting difference.

Measure the boundary that actually matters

Tool Swim reports the UTF-8 byte size before and after minification. That is useful for a bounded request field or a storage limit, but it is not the compressed transfer size and does not predict parsing time by itself. Measure the final encoded and compressed artifact in the real delivery path when performance is the goal.

The browser tool caps each input and output at one mebibyte to avoid turning an interactive utility into a main-thread stress test. Larger production data should be handled with a streaming, reviewed workflow on a trusted machine rather than pasted into a general web page.

Primary standards

Questions and answers

Related JSON tools

Related JSON guides