VSThiran

Technology & Developers

API Response Size Calculator

Estimate how big each API response is, how much compression saves, and how much data and bandwidth your traffic uses.

Free to useNo sign-up requiredNo watermarkRuns in your browser

Response size drives latency, mobile data use and - often most painfully - cloud egress bills. It is also easy to estimate: a list endpoint returns some number of records, each of roughly the same size, wrapped in a little metadata.

This calculator multiplies that out, applies your compression savings, and scales it to daily and monthly transfer and to the average and peak bandwidth your servers or CDN need to carry. Every figure is shown with the working, so you can see which input matters most.

How this tool works

  1. Describe one response

    Records per response and the average size of one record in B, KB or MB, plus envelope overhead.

  2. Set compression

    Pick none, a typical gzip or Brotli saving, or enter the saving you measured.

  3. Enter your traffic

    Requests per day and how much busier your peak is than the average.

  4. Read the totals

    Size on the wire, daily and 30-day transfer, and average and peak bandwidth.

How it works

The uncompressed body is records × bytes per record plus the envelope overhead - pagination fields, wrapper objects and links. The compressed size removes your compression saving from that.

Daily transfer is the compressed size × requests per day, and monthly transfer is that × 30. Average bandwidth spreads the daily bytes evenly over 86,400 seconds and converts to bits (× 8); peak bandwidth multiplies the average by your peak-to-average ratio.

All sizes are decimal, as networks and cloud providers bill them: 1 KB = 1,000 bytes and 1 GB = 1,000,000,000 bytes.

Common use cases

  • Choosing a page size for a list endpoint.
  • Estimating cloud or CDN egress before launching a feature.
  • Checking whether turning on compression is worth it for an API.
  • Budgeting mobile data use for an app that polls an endpoint.
  • Sizing network capacity for peak traffic.

How much does compression save on JSON?

JSON repeats the same field names in every object, which general-purpose compressors handle very well. Published measurements for typical JSON API responses commonly show gzip saving somewhere around 60-90%, with larger, more repetitive arrays at the top of that range. Brotli usually does somewhat better than gzip on text.

Savings drop sharply for small bodies (under about 1 KB, where many servers do not compress at all) and for content that is already random-looking - UUIDs, hashes, encrypted or base64-encoded blobs, or images. The only reliable figure is one you measure: compare the Content-Length of a real response with and without Accept-Encoding.

Ways to shrink a response

  • Return only the fields the client uses - sparse fieldsets or a GraphQL selection.
  • Paginate, and pick a page size that matches what the screen shows.
  • Drop null and default-valued fields from the output.
  • Serve unchanged data with ETags so repeat requests get a small 304 response.
  • Enable gzip or Brotli at the server, gateway or CDN.

Formula

Response size

records × bytes per record + overhead

Compressed size

response size × (1 − compression %)

Daily transfer

compressed size × requests per day

Monthly transfer

daily transfer × 30

Average bandwidth

daily transfer × 8 ÷ 86,400 (bits per second)

Peak bandwidth

average bandwidth × peak-to-average ratio

Worked examples

A paginated list endpoint

100 records of 500 bytes plus 200 bytes of metadata is 50,200 bytes. With gzip saving 70% it is 15,060 bytes on the wire. At 100,000 requests a day that is 1.51 GB a day, 45.2 GB over 30 days, averaging 139 kbps and about 418 kbps at a 3× peak.

An uncompressed export

1,000 records of 2 KB is 2 MB per response. At 10,000 requests a day with no compression, that is 20 GB a day, 600 GB a month and an average of 1.85 Mbps.

Frequently asked questions

Does this include HTTP headers?

No - response bodies only. Headers typically add a few hundred bytes per response (less with HTTP/2 or HTTP/3 header compression), which matters mainly when bodies are tiny.

How do I find the average size of a record?

Take one real response, measure its size, subtract the envelope, and divide by the number of records. The JSON Size Calculator will measure a pasted sample for you.

Why 30 days for a month?

It is a simple, consistent convention. For a 31-day month multiply the daily figure by 31; the difference is about 3%.

What peak-to-average ratio should I use?

It depends on your traffic. Business apps concentrated in office hours often peak at several times the 24-hour average; global consumer traffic tends to be flatter. Your monitoring can give you the real ratio.

Are KB and MB 1,000 or 1,024 bytes here?

1,000 - decimal units, which is how network speeds and most cloud data-transfer charges are stated.