JSON Minify with Stats

Minify JSON and report size reduction, key count, depth, and value-type breakdown.

Original
155 B
Minified
113 B
Pretty (2sp)
249 B
Reduction
27.1%
Keys
10
Depth
5
Objects
4
Arrays
3
Strings
5
Numbers
4
Nulls
0
{"users":[{"id":1,"name":"Ann","tags":["a","b"]},{"id":2,"name":"Bob","tags":["c"]}],"meta":{"total":2,"page":1}}

About JSON Minify with Stats

JSON Minify with Stats removes every byte of insignificant whitespace from a JSON document and reports what changed: original size, minified size, percentage saved, key count, maximum depth, and a breakdown of value types (object, array, string, number, boolean, null). The output is the smallest valid JSON representation; the stats are an ergonomic sanity check.

Use this when JSON Formatter's minify mode is not enough — when you need to know how much you saved or to spot anomalies. A depth of 23 in a config file usually indicates an accidentally nested array; a value-type histogram with 99% strings hints that numbers were stringified somewhere upstream. Common contexts: shrinking a JSON payload before embedding in a URL or HTML attribute, comparing the wire-size cost of two API shapes, or auditing configuration files. Everything runs locally with the browser's JSON parser; no payload leaves your device.

Examples

Input
{
  "ok": true,
  "items": [1, 2, 3]
}
Output
{"ok":true,"items":[1,2,3]}

stats: 32 → 27 bytes (15% saved), 2 keys, depth 2

The output box shows the minified JSON; the stats panel shows the size reduction and structural metrics.

Frequently asked questions

How is this different from JSON Formatter's minify mode?

Formatter's minify just strips whitespace. This tool also computes size reduction, depth, key count, and a value-type histogram. Use Formatter when you only need the minified output; use this when the stats matter.

What counts as 'depth'?

The maximum nesting level. A flat object `{a:1}` is depth 1; `{a:{b:1}}` is depth 2. Arrays count too: `[{a:1}]` is depth 2.

Are stats computed on the input or the output?

Both. Size is reported for input and minified output; structural stats (depth, key count, type histogram) are about the parsed document, which is identical for input and output.

Can I use this on JSON Lines (NDJSON)?

No. The tool expects a single JSON document. For NDJSON, run line-by-line through Filter Lines by Regex first or process each line separately.