JSON Size Calculator
Calculates raw byte size, minified byte size, percentage space savings, maximum nesting depth, total key count, object count, array count, and null value count for any JSON payload. These metrics help you spot bloated payloads, deeply nested structures, or unexpectedly large responses before they reach production. Paste your JSON and results update instantly — nothing leaves your browser.
JSON
Size Analysis
278 B
0.27 KB
Raw Size
239 B
0.23 KB
Minified Size
14.0%
Space Savings
3
Max Depth
16
Total Keys
4
Objects
1
Arrays
0
Null Values
What is JSON Size Analyzer?
"How big is this payload?" is a question with more nuance than it appears. The formatted JSON in your editor looks bigger than the minified version that travels over the wire. The UTF-8 byte count differs from the character count for non-ASCII content. And the size that matters for localStorage is different from the size that matters for an API gateway body limit. This tool answers all of these at once: minified byte size (what counts for HTTP Content-Length), formatted byte size, UTF-8 character count, total key count including nested keys, total value count, maximum nesting depth, and array element totals. A per-key breakdown identifies which fields contribute most to the overall size — useful for payload optimisation when a specific section is unexpectedly large. Paste any JSON payload to instantly check it against common limits: AWS API Gateway (10 MB), localStorage (5 MB per origin), or HTTP header size constraints.
How to Use
- 1
Paste Your JSON
Paste the JSON content you want to measure. Both minified and pretty-printed JSON are accepted — the tool reports size for both representations regardless of which you paste.
- 2
Review the Size Metrics
Metrics are calculated instantly: minified byte size, pretty-printed byte size, key count, value count, max nesting depth, array element totals, and the largest individual key and value.
- 3
Identify Size Issues
Use the breakdown to spot oversized sections — large arrays, deeply nested structures, or unexpectedly large string values. The tree view highlights which keys contribute most to the total size.
- 4
Copy the Size Report
Copy the size summary as text for inclusion in a performance ticket, PR description, or API documentation — or download the full size breakdown as JSON.
Common Use Cases
API Payload Size Auditing
Measure the byte size of API request and response payloads to identify oversized endpoints, validate against size limits (e.g., AWS API Gateway 10MB limit), and optimise data transfer.
localStorage Budget Management
Check the size of JSON data before storing it in localStorage (5MB limit per origin) or sessionStorage to prevent quota exceeded errors and plan data pruning strategies.
HTTP Header Size Validation
Measure the size of JSON values intended for use in HTTP headers (Authorization tokens, custom metadata) to ensure they stay within web server header size limits (typically 8KB).
Bundle & Dependency Analysis
Measure the size of JSON data files, translation bundles, or config objects embedded in JavaScript applications to identify candidates for minification, lazy loading, or code splitting.
Conversion Examples
JSON Object → Size Breakdown
Reports byte size, character count, key count, and nesting depth.
Input JSON
{
"id": 1,
"name": "Alice",
"email": "alice@example.com",
"roles": ["admin", "editor"],
"address": {"city": "London", "zip": "EC1A"}
}Output CSV
Minified size: 112 bytes Formatted size: 168 bytes Character count: 112 Key count: 7 (including nested) Max depth: 3 Array elements: 2
Large Array → Size Estimate
Useful for estimating API payload size before sending large datasets.
Input JSON
[
{"id": 1, "name": "Alice", "score": 95},
{"id": 2, "name": "Bob", "score": 87}
// ... 1000 items total
]Output CSV
Minified size: ~38 KB (1000 items) Formatted size: ~52 KB Items: 1000 Avg item size: 38 bytes