About this tool
JSON Stats walks the document recursively and measures original UTF-8 bytes, minified bytes, maximum nesting depth, total keys, object and array counts, value type counts, and the longest string. It describes structural scale rather than interpreting business meaning.
Original size includes source whitespace while minified size comes from serializing strict JSON again, so their difference estimates formatting overhead. Every node is visited, making time and memory grow with the number of values in a large document.
How to use it
Paste the full document
Enter strict JSON, JSONC, or JSON5 and let the parser establish that the structure is valid.
Read structural metrics
Use depth, key count, and object or array counts together rather than judging complexity from file size alone.
Investigate unusual signals
If the longest string, nesting depth, or a type count looks abnormal, inspect the producer of the source data.
Input and output example
A structural summary rather than the data itself. The size comparison tells you whether minifying is worth it.
{
"users": [
{ "id": 1, "tags": ["a"] },
{ "id": 2, "tags": [] }
]
}Max depth 4
Total keys 7
Types object 3 / array 3 / number 2 / string 1
Formatted size 92 B
Minified size 54 BSupported range and limits
- What it reports
- Maximum nesting depth, total key count, type distribution, array lengths, and formatted vs minified size
- Main use
- Sizing up unfamiliar data before deciding how to process it
- Why depth matters
- Deep nesting slows tree rendering and serialisation, and hints that the data model may need splitting
- Why type distribution matters
- One field holding different types across elements is usually a data-quality signal
- Size comparison
- Shows how much minifying saves, which tells you whether it is worth doing at the transport layer
- What it does not do
- Only measures; the input is never modified
When you would use it
Estimating an API payload
Compare formatted and minified bytes and see whether repeated nesting is inflating the response.
Auditing generated data
Use type distribution and longest-string output to spot unexpected nulls, embedded text blobs, or deep objects.
Deciding whether transport compression is worth it
Comparing formatted against minified size tells you whether an endpoint needs minification or gzip enabled.
What to know before you start
- Size uses UTF-8 bytes, so a Chinese character does not normally equal one byte.
- Depth begins at the root value and can differ by one from libraries that call the root level one.
- Statistics do not deduplicate repeated structures; every occurrence is traversed and counted.
Related concepts
- UTF-8 byte size
- The encoded byte length of text, which is closer to transfer size than JavaScript string length.
- maximum depth
- The number of nested levels on the deepest route from root to leaf, useful for spotting excessive complexity.