JSON Size Calculator
Describe your data: how many records, how many fields each, and the typical length of keys and values. The calculator estimates the size minified, pretty-printed and gzipped, so you can plan API limits and page weight.
- Minified and pretty
- Gzip estimate
- Per-record size
For an array of flat objects. Nested objects add a few extra bytes for each level of braces.
Every quote, colon and comma in JSON takes a byte. An object with eight short fields can be twice the size of the data it carries. Key names repeat in every record, so long keys add up fast. Gzip removes most of that repetition, which is why compressed API responses are often 80% smaller.
JSON size limits
Common platform limits. Search for a service.
| Service or setting | Limit | Notes |
|---|---|---|
| AWS API Gateway | 10 MB | Request payload |
| AWS Lambda (sync) | 6 MB | Request and response |
| Azure Functions HTTP | 100 MB | Request body |
| Express body-parser default | 100 KB | Raise with the limit option |
| Nginx default | 1 MB | client_max_body_size |
| Firestore document | 1 MiB | Per document |
| MongoDB document | 16 MB | BSON size |
| localStorage | 5 MB | Per origin, most browsers |
Limits change over time. Check the current documentation for the service you use.
Record count and size
Eight fields per record. Slide the number of records.
Paginate API responses so each page stays under about 100 KB gzipped. Pages load fast and stay well inside server limits.
How JSON size adds up
Count the characters. Step through it.
Each field
"key":"value" is key + value + 5 bytes for quotes and colon.
Measure a real response in your browser's network panel. It shows both the transferred (compressed) size and the actual size.
Pretty, minified or gzipped
Three sizes of the same data. Compare them.
Indented and readable. Good for config files and debugging.
All whitespace removed. What APIs normally send.
Compressed in transit and unpacked by the browser.
Most web servers gzip JSON automatically. Brotli compression is often 15% to 20% smaller again.
Shrinking a JSON payload
Quick wins for faster APIs. Tick each item.
Tick each item as you go.
Removing unused fields is usually the biggest saving. Many APIs send every column when the page shows three.
What you get
Size from every angle. Each tile explains one result.
Size with no whitespace.
Size with 2-space indents.
What travels over the network.
Average bytes per object.
At 10 Mbps, compressed.
The keys share shows how much of the payload is field names. Above 40%, shorter keys or a columnar format could help.
Frequently Asked Questions
No question matches that search.
How do I calculate JSON size?
Count every character including quotes, colons, commas and brackets. For plain ASCII each character is one byte.
How big is 1,000 JSON records?
With eight short fields each, about 200 KB minified and 40 KB gzipped.
Does whitespace count in JSON size?
Yes. Pretty-printing can add 20% to 40%. Minifying removes it.
How much does gzip reduce JSON?
Usually 70% to 90%, because key names repeat in every record.
What is the maximum JSON size?
JSON itself has no limit. Servers, APIs and databases set their own, often 1 to 10 MB.
Are non-English characters bigger?
Yes. In UTF-8 they take two to four bytes each.
Should I use shorter key names?
It helps uncompressed size. With gzip on, the saving is small.
Ship lighter JSON
Estimate the payload before you build, check it against your limits and turn on compression. Trim unused fields and paginate large lists, and your API will stay fast as the data grows.
More size calculators
Each one has its own calculator, worked examples and answers to common questions.