CalcEngine All Calculators

JSON Size Calculator

Data & Formats

Paste any JSON to see its exact byte size and KB. Validates syntax in real time — no backend, no sign-up.

Last updated: April 2026

This calculator is designed for real-world usage based on typical engineering scenarios and publicly available documentation.

JSON payload size matters more than most developers realize. AWS API Gateway rejects payloads over 10 MB. Lambda has a 6 MB synchronous invocation limit. Mobile networks degrade when responses exceed a few KB. Knowing your JSON size before you deploy can prevent silent failures in production. This JSON size calculator shows the exact byte count and kilobyte size of any JSON string, using the same UTF-8 encoding your browser and server will use. Paste your payload and get an instant result — no backend, no guessing. It also validates JSON syntax on the fly, so malformed payloads are caught before they reach your API. Use it to verify a payload fits within an API's size limit, compare minified vs. pretty-printed JSON sizes, check whether a cached response is worth compressing, or debug unexpected 413 Payload Too Large errors.

How to Calculate JSON Payload Size

JSON Size — how it works diagram

1. Paste your JSON into the input field. 2. The calculator runs JSON.parse to validate syntax — invalid JSON is flagged immediately. 3. It encodes the string as UTF-8 using the Blob API, which mirrors how browsers and servers measure payload size. 4. Size is displayed in bytes and kilobytes.

Formula

Size (bytes) = UTF-8 encoded byte length of the JSON string
Size (KB)    = Size (bytes) ÷ 1,024

Encoding rules:
- ASCII characters (a-z, 0-9, brackets, quotes) = 1 byte each
- Latin accented characters (é, ñ) = 2 bytes each
- CJK characters and emoji = 2–4 bytes each

Example JSON Size Calculations

Example 1 — Simple API response (all ASCII)

Input:   {"user":"alice","role":"admin","active":true}
Bytes:   50  (all ASCII — 1 byte per character)
KB:      50 ÷ 1,024 = 0.049 KB

Example 2 — Minified vs. pretty-printed comparison

Pretty:    {"user": "alice", "role": "admin"}  →  39 bytes
Minified:  {"user":"alice","role":"admin"}      →  33 bytes
Savings:   6 bytes (15%) — just by removing whitespace

Example 3 — Large paginated response (check against API limits)

Response with 100 records, ~800 bytes each:
Estimated size: 100 × 800 = 80,000 bytes = 78 KB

AWS API Gateway limit: 10 MB → safe
Cloudflare Worker limit: 100 MB → safe
Lambda sync limit: 6 MB → safe
Recommended max for mobile: ~200 KB → safe, but worth paginating

Tips to Reduce JSON Payload Size

Notes

Frequently Asked Questions

Does whitespace affect JSON size? +
Yes. Every space, tab, and newline adds bytes. Pretty-printed JSON is typically 15–30% larger than minified JSON. Always strip whitespace from production API payloads with JSON.stringify(data) (no spacing argument).
What encoding does this calculator use? +
UTF-8, which is the JSON standard per RFC 8259. Most APIs and browsers default to UTF-8. The Blob API used here mirrors real-world browser behaviour exactly — the byte count matches what your server will see.
Why do emoji and non-ASCII characters make JSON larger? +
ASCII characters (a–z, 0–9, punctuation) are 1 byte each in UTF-8. Latin accented characters (é, ñ) are 2 bytes. Emoji and CJK characters are 3–4 bytes. A string with 100 emoji can be 300–400 bytes instead of 100.
What are common API payload size limits? +
AWS API Gateway: 10 MB. AWS Lambda sync invocation: 6 MB. Cloudflare Workers: 100 MB request body. Most REST APIs recommend keeping responses under 1 MB for mobile performance. Check your specific provider's docs.
How do I check the size of a JSON file rather than a string? +
Paste the file contents into the calculator above — the result is identical to the file size on disk (assuming UTF-8 encoding, which is the JSON default). Alternatively, check file properties in your OS or run wc -c filename.json in a terminal.