JSON Size Analyzer
Visual breakdown of which keys contribute most to your JSON file size. Runs in your browser.
How JSON Size Analysis Works
The JSON Size Analyzer measures the serialized byte size of each key's value in your JSON document. For every key at the top level (and one level deep), the tool calls JSON.stringify(value) and counts UTF-8 bytes using the TextEncoder API. This gives a precise picture of which fields dominate your payload.
The summary row shows the raw byte count (your original input), the minified byte count (no whitespace), and the savings percentage. Savings can be significant for pretty-printed JSON — sometimes 20–40% of bytes are whitespace. The bar chart ranks the top 15 keys by their contribution to the minified size, making it easy to spot bloated nested objects, long string arrays, or unnecessarily verbose field names. Everything runs entirely in your browser; no data is uploaded anywhere.
What the Stats Mean
- Raw bytes — the exact size of what you pasted, whitespace included.
- Minified bytes — the size after removing all whitespace, which is closer to what actually travels over the wire for a compact API response.
- Key count — the total number of object keys found anywhere in the document, at any depth.
- Max depth — how many levels of nesting the deepest value sits at, a quick signal for how complex the shape is.
- Array count — the total number of arrays in the document, at any depth.
Where Size Analysis Helps
- ▸Trimming a bloated API response — Find the one field — a base64 blob, a verbose nested object, a long array — responsible for most of a slow endpoint's payload size.
- ▸Deciding what to paginate — See exactly which array is driving response size to justify adding pagination or a summary/detail split.
- ▸Comparing before/after a schema change — Check whether a proposed field addition or rename meaningfully changes payload size before shipping it.
- ▸Auditing a config or state file — Spot an accidentally-duplicated or overly verbose section in a large JSON config or serialized app state.