JSON Size Calculator
Paste a JSON document to see how many bytes it really weighs, how much minifying and gzip save, and which values take the most space.
Processed locally in your browser/ Your data stays in your browser.
What is JSON Size Calculator?
The size of a JSON document is the number of UTF-8 bytes on the wire, which is not the same as the number of characters: an accented letter takes two bytes and an emoji four. This tool parses your JSON with a strict RFC 8259 parser, then reports the raw size, the minified size, the pretty-printed size for the indentation you choose, and an estimate of the gzip size.
It also counts keys and distinct key names, measures the maximum nesting depth, counts values by type and splits the bytes between strings, numbers, keys and punctuation. A ranked table lists the largest values with a JSONPath-like path such as $.users[2].bio, so you can spot the field that bloats an API response.
How does it work?
- Paste your JSON into the input box; it is validated strictly and any syntax error is reported with line and column.
- Pick the indentation used for the pretty-printed figure and choose whether to estimate the gzip size.
- Choose whether the table ranks everything, only scalar values or only objects and arrays, and how many rows to show.
- Read the size summary and the table of heaviest paths, then trim or restructure those fields.
Common use cases
- Checking whether an API response fits a payload limit such as a message queue, a cookie, a URL parameter or a serverless request cap.
- Finding the one field (an inlined image, a long description) that makes a response ten times bigger than expected.
- Estimating the bandwidth saved by minifying and gzip before deciding whether compression is worth enabling.
- Comparing the cost of long descriptive key names against short ones across thousands of records.
Examples
Try this input in the tool above:
{
"users": [
{"id": 1, "name": "Ada Lovelace", "bio": "Mathematician and writer who described the first algorithm intended for a machine.", "tags": ["math", "code"]},
{"id": 2, "name": "Grace Hopper", "bio": "Computer scientist and Navy rear admiral.", "tags": ["compilers"]},
{"id": 3, "name": "Zoé Ünal", "bio": null, "tags": []}
],
"meta": {"page": 1, "total": 3, "generated": "2026-09-24T21:00:00Z", "ok": true}
}Raw input (UTF-8): 437 B · 435 characters Minified: 381 B · saves 12.8 % Pretty-printed (2 sp.): 587 B · +54.1 % vs minified gzip (of the minified JSON): 275 B · about 72.2 % of the minified size Total keys: 18 (10 unique names) Bytes spent on key names: 104 B · 27.3 % Maximum depth: 4 Values by type: 5 objects · 4 arrays · 9 strings · 5 numbers · 1 booleans · 1 null Bytes by content: strings 212 · numbers 5 · booleans/null 8 · keys 104 · punctuation 52
Privacy
JSON Size Calculator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
The gzip figure comes from the browser compressor at its default level and is only an estimate; the size of a value is measured as it would appear in minified JSON, and nested containers include their children.
Frequently asked questions
Why is the byte size larger than the character count?
JSON is transmitted as UTF-8. ASCII characters take one byte, most accented letters two, many Asian characters three and emoji four. The report shows both figures so you can see the difference.
How is the size of each value in the table computed?
It is the UTF-8 length of the value written as minified JSON. For a string that includes its quotes and escapes; for an object or array it includes braces, commas, colons and all its children, so a parent is always at least as large as any child.
What if gzip shows as unavailable?
The estimate uses CompressionStream, which every current browser provides. In an older browser the tool still reports all the other sizes and tells you the gzip figure could not be computed.
Related tools
JSON Minifier
Compress a JSON document to one compact line and see how many bytes you saved.
JSON & Data
JSON Formatter & Beautifier
Turn a minified or messy JSON document into readable, consistently indented text, with a precise error message if the JSON is invalid.
JSON & Data
JSON Viewer
Explore a JSON document as an expandable tree instead of a wall of text, with a summary of its structure.
JSON & Data
JSON Validator
Check whether a piece of text is valid JSON and locate the exact character where it goes wrong.
JSON & Data
JSONPath Finder
Type a JSONPath expression and instantly see the values it selects in your JSON, together with the normalized path of each match.
JSON & Data
File Size Converter
Type a size like 1.5 GB or 700 MiB and see it in every unit, both decimal (SI) and binary (IEC).
File Tools
JSON to TypeScript
Paste a JSON sample and get ready-to-use TypeScript declarations that describe its shape.
JSON & Data