JSON size analyzer
About JSON Size Analyzer
The JSON size analyzer measures how big a JSON payload is and shows which parts take up the space. It reports the total bytes, the number of keys, the maximum nesting depth and a ranked list of the heaviest paths.
Use it to trim a bloated API response or find the one base64 image or verbose array that makes a payload large. Runs in your browser. Nothing is uploaded.
How it works
Byte sizes, measured exactly
The total is the minified UTF-8 byte length, measured with TextEncoder. That is what travels over the wire once whitespace is removed. Emoji, accents and non-Latin scripts count at their real byte cost. The report also shows the size of your input as pasted and the size when pretty-printed.
Heaviest paths, ranked
Every subtree is measured by its own JSON byte size. The top 10, 25 or 50 are listed largest first, with path, bytes, percent of the total and value type. Paths use dot and bracket notation like `profile.links.site` and `scores[3]`, the same as the flattener.
Subtrees or leaves only
By default the ranking includes whole objects and arrays, which shows heavy branches like an entire `profile` object. Turn on Leaves only to rank just the single values (strings, numbers, booleans and null) and find the fields that dominate.
Key count and depth
The report counts every object key in the document and gives the maximum nesting depth. Very deep nesting slows parsers and makes access awkward. A huge key count often points to data that should be paginated or normalized.
Frequently asked questions
Is my JSON uploaded anywhere?
No. The analysis runs in your browser and works offline, so it is safe for production payloads.
How is the total byte size calculated?
It is the UTF-8 byte length of the minified JSON, measured with the browser's TextEncoder. That is the true wire size without whitespace, with multi-byte characters counted at their real cost.
Can it count the keys in my JSON?
Yes. keyCount in the report is the total number of object keys at every level. Array elements are not counted as keys, but each object inside an array adds its keys.
Does it show the gzipped size?
No. Sizes are raw, uncompressed bytes. Gzip in the browser needs an async streaming API that does not fit this tool's design. Gzip usually shrinks JSON by 60-90%, so the transfer size will be much smaller than the total here.
What is the difference between subtree and leaves-only mode?
Subtree mode (the default) also ranks whole objects and arrays, so you see heavy branches. Leaves-only mode ranks single values only, which is better for finding one long string or base64 blob.
Why don't the listed percentages add up to 100%?
Nested paths overlap, because a parent's bytes already include its children. Braces, commas and key names are not assigned to any single path. In leaves-only mode, values exclude their keys and punctuation, so the sum is below 100%.
Sources & last verified
We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.
Found a wrong result or an outdated claim? Report an error and we will check it again.