Skip to main content
Calcimator

JSON Size Calculator

Estimate JSON payload size based on key count, value lengths, nesting depth, and array size. See minified and gzipped estimates.

This calculator estimates the size of a JSON payload from its structural shape rather than actual data: Keys Per Object, Avg Key Length, Avg Value Length, Nesting Depth, and Array Size. Total Characters approximates each key-value pair as its key length plus its value length plus 7 characters of JSON syntax overhead (quotes, colon, space, comma) plus a newline and per-line indentation, multiplied by Keys Per Object, plus a per-object overhead for nesting braces on their own indented lines, all multiplied by Array Size when the payload is an array of repeated objects. Array Size has an outsized effect on Total Characters compared to the other four inputs, because it multiplies the ENTIRE per-object character count rather than adding to one term inside it -- doubling the array size roughly doubles the whole payload, while doubling Keys Per Object only affects the per-key-value-pair portion of each object. Minified Size counts the same payload with every newline, indent and post-colon space removed -- around 82% of the pretty-printed count at typical key and value lengths -- and Gzipped Estimate applies a flat 30% compression ratio to the pretty-printed count, not compounded with the minification figure, since gzip's own entropy coding subsumes most of what minification removes; measured against real gzip on JSON with high-entropy values, 30% of the pretty-printed size is close (33-34% across array sizes from 5 to 1,000), while highly repetitive values compress considerably better than this figure suggests. Gzipped Estimate is floored at 20 bytes, since real gzip output carries a fixed header-and-trailer overhead that a pure percentage cannot go below. These are structural estimates based on average lengths, not an actual byte count of real data -- true payload size varies with real key/value content, Unicode characters, and the specific JSON serializer's formatting choices.

Inputs

chars
chars

Results

Estimated Size

1.92 KiB

Total Characters1,963 chars
Minified Size1,462 chars
Gzipped Estimate~589 bytes
Fits in 1 MB~534 full payloads (~2,671 objects)
How to Use This Calculator
  1. Enter the number of Keys Per Object in your JSON structure (e.g., 10 for a typical API response object).
  2. Set the average key length in characters (e.g., 8 for names like 'username') and the average value length (e.g., 15).
  3. Enter the Nesting Depth for nested objects — 0 is flat, 2–3 is typical for REST APIs.
  4. Set the Array Size if your payload contains repeated objects (e.g., 100 items in a list).
  5. Review Estimated Size, Minified Size, and Gzipped Estimate to plan API payloads and bandwidth budgets.

What each input means

Keys Per Object
Number of key-value pairs.
Avg Key Length
Average length of JSON keys.
Avg Value Length
Average length of JSON values.
Nesting Depth
Depth of nested objects.
Array Size
Number of elements in the array.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    5 parameters
    Keys Per Object = 10, Avg Key Length = 8, Avg Value Length = 15, Nesting Depth = 2, Array Size = 5 = 5 input(s) provided
  2. Calculate Estimated Size
    1.92 KiB = 1.92 KiB
  3. Calculate Total Characters
    Total Characters
    1963 = 1963
  4. Calculate Minified Size
    Minified Size
    1462 = 1462

Engine last updated . Checked against 2 independently-derived tests how we verify calculators.

Frequently Asked Questions

Why does Array Size affect the total size more than Keys Per Object?

Array Size multiplies the entire character count of one object -- keys, values, and nesting overhead together -- because each additional array element repeats the whole object structure. Keys Per Object only adds more key-value pairs within a single object, so it changes a smaller share of the total. Doubling Array Size roughly doubles Total Characters; doubling Keys Per Object does not.

Is Minified Size the actual size after running a real minifier?

No -- it's an estimate, counted directly without the newlines, indentation and post-colon spaces the pretty-printed Total Characters figure includes, typically around 82% of it for typical key and value lengths. A real minifier's output depends on the actual data and formatting style, so use this figure for rough payload-size planning, not as an exact byte count.

How much does Nesting Depth add?

Less than Array Size or Keys Per Object at typical values -- each nesting level adds a couple of characters of indentation to every line of every object. It compounds with Array Size, though, since every repeated object in the array carries the same nesting overhead.

What does 'Fits in 1 MB' tell me?

It reports how many full copies of your described structure -- the whole array, as configured -- fit inside a 1 MB (1,048,576-byte) payload, and separately how many individual objects that represents (full payloads multiplied by Array Size). Earlier versions of this figure quoted only the payload count under an "Objects per 1MB" label, which undercounted the true object count by a factor of Array Size. It's meant to help size API pagination or batch limits around a target payload size.

Why is the Gzipped Estimate so much smaller than Minified Size?

JSON is highly repetitive text -- the same key names and syntax characters (quotes, colons, commas, braces) repeat across every object in an array -- and gzip compression is very effective at exploiting exactly that kind of repetition, typically compressing repetitive JSON to roughly 30% of its uncompressed size, well beyond what simply removing whitespace achieves. For very small payloads the estimate is floored at 20 bytes, since real gzip output always carries a fixed header-and-trailer overhead that a pure percentage would understate.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Technology & Computing.