JSON size
Estimate JSON payload bytes from character length and a bytes-per-char model (UTF-8/UTF-16). A heuristic for APIs and body limits — not a full parser. Results after Calculate.
Results
Enter data and click Calculate.
What JSON size means in practice
Payload size is bytes of JSON text on the wire or on disk — not the number of fields. This calculator estimates character count × bytes/char + optional overhead.
Default UTF-8 min (1 B/char ASCII) fits typical APIs. It is a heuristic: measure precisely with TextEncoder / Buffer.byteLength(JSON.stringify(...)).
What increases JSON payload size
- Long key names repeated on every array item.
- Deep nesting — each level adds
{},[], commas. - Long strings, especially with escaping (
",\, controls). - Pretty-print whitespace vs compact minified JSON.
Pretty JSON vs minified (and vs transfer)
Pretty-print is for humans. APIs usually send minified JSON. This tool only sees the length you enter — compare both versions separately.
- Count pretty characters → estimate A.
- Minify (
JSON.stringifywithout spaces) → estimate B — usually much smaller. - Gzip lowers transfer; gateway limits often still count uncompressed bytes.
Repeated keys vs values
An array of 1000 objects with userId, createdAt, status pays for each key name a thousand times. Shorter keys or binary protocols cut that cost; JSON stays readable but verbose.
Values matter too: Base64 inside a string first grows ~33% (separate calculator), then adds to JSON length.
Escaping, Unicode, and transport
- UTF-8 min — ASCII = 1 B/char (typical APIs).
- UTF-8 max — pessimistic up to 4 B (emoji, rare characters).
- UTF-16 — some JS runtime string metrics; not the same as HTTP body bytes.
- Escaping quotes and backslashes makes strings longer than the user’s raw text.
Examples: characters → estimate (UTF-8 min)
Enter your length in the form — the table shows order of magnitude.
| Scenario | Chars (approx.) | Est. bytes | Note |
|---|---|---|---|
| Small API object | 200 | 200 | ASCII, minified |
| Pretty one object | 500 | 500 | whitespace included |
| Array 100× same keys | 8000 | 8000 | keys ×100 |
| String with many \" | +esc | more than content | escaping costs |
Illustrative — your result depends on the character count and model you choose.
FAQ — JSON size
How to read the heuristic and when to measure precisely.
- Is this my exact JSON size?
- No — it is a character-length estimate. Use
TextEncoder/Buffer.byteLength(JSON.stringify(...))for exact bytes. - Which model for HTTP APIs?
- Usually UTF-8 min for ASCII. With lots of Unicode, try UTF-8 max or measure the body.
- What is the Overhead field?
- Optional extra bytes (wrapper/framing). Default 0.
- Pretty vs minified?
- The tool only sees the length you enter. Compare pretty and minified lengths separately.
- Does gzip change this result?
- Not directly — this is text size. Gzip lowers transfer; gateways often still use uncompressed bytes.
- How does Base64 inside JSON affect size?
- Estimate Base64 overhead (~33%) first, then include that string length in the JSON estimate.
- Do empty arrays/objects weigh nothing?
- They still cost structural characters. With many elements it adds up.
- UTF-16 here vs HTTP responses?
- JSON HTTP bodies are usually UTF-8. UTF-16 is for runtime string models — not Content-Length.