API Payload Size Calculator
Estimate JSON API payload size and gzip-compressed size from field count, average field size, array items, and nesting depth.
How to Use the Payload Size Calculator
- Enter number of JSON fields.
- Enter average field size in bytes.
- Enter number of array items.
- Enter nesting depth.
- Click Calculate to get estimated payload and compressed size.
Casi d'Uso
- •Optimizing API response sizes for mobile clients.
- •Evaluating GraphQL vs REST payload efficiency.
- •Planning network bandwidth for API-heavy applications.
- •Identifying over-fetching in API designs.
Formula
Raw size = fields × avg field size × (1 + array items × 0.1) × nesting overhead. Compressed ≈ raw × 0.30 (gzip ~70% compression).
Domande Frequenti
How much does gzip compress JSON?
Gzip typically compresses JSON by 60–80% due to its high text repetition, resulting in 20–40% of original size.
What is a good API payload size?
Keep payloads under 100 KB for good performance. Paginate large lists and use field selection to reduce payload size.
Should I use MessagePack instead of JSON?
MessagePack is 20–50% smaller than JSON for binary data, but JSON is more debuggable and universally supported.