Measure JSON file size, structure, and nesting depth
The size analyzer measures the exact JSON text and summarizes its structural complexity. It helps explain whether payload size comes from whitespace, long strings, or a broad/deep structure.
When should you use it?
- Check an API payload against a byte limit.
- Compare object depth before building a viewer.
- Estimate how many records or scalar values a fixture contains.
Example: measure text and structure
The byte count includes braces, quotes, punctuation, and values in the exact source text.
{"a":[1,true]}UTF-8 bytes: 14
Objects: 1
Arrays: 1
Array items: 2Use bytes when the question is file or request size
A character and a UTF-8 byte are different units. ASCII text commonly occupies one byte per character, while many other characters require several. This analyzer measures the actual UTF-8 input and counts structural features such as values, properties, array items, and depth. Those numbers help distinguish a whitespace-heavy document from one containing many records or long string values.
Measure the layer that has the limit
An API gateway may limit the request body; a browser store may have a quota; an LLM has a token budget. Those limits do not all use the same unit. Use Minifier to compare removable layout and Token Counter for the supported tokenizer. The analyzer does not predict gzip size, heap memory consumption, or network timing. Measure those in the system where they matter.
How do I measure the UTF-8 size and nesting depth of JSON?
Paste the exact text you plan to send or store. The report counts its UTF-8 bytes, UTF-16 code units, values, properties, array items, and maximum depth. Whitespace counts toward bytes, so a formatted and minified copy can have different sizes with the same JSON structure.
JavaScript: byte length of the same source text
javascriptconst source = '{"a":[1,true]}';
console.log(new TextEncoder().encode(source).length); // 14This mirrors the UTF-8 byte concept in the report. It does not measure a gzip response body or the memory used by a parsed object.
Why are characters and UTF-8 bytes different?
Non-ASCII characters can occupy multiple UTF-8 bytes, while JavaScript string length counts UTF-16 code units. Use the byte figure for a byte-limited transport and inspect the destination’s own limits.
What should you check before using the result?
These are measurements of this input text, not compressed transfer size or memory use in another program. Minify the source separately to compare structural whitespace.
Understand JSON syntaxTechnical reference: JSON syntax and interoperability · RFC 8259