Home → JSON Size Analyzer
Analyze your JSON payload to see which keys contribute most to total size.
Analyze your JSON payload to see which keys contribute most to total size. This tool runs entirely in your browser — no data is ever sent to a server. Free to use, no account required.
The size analyzer provides detailed metrics about your JSON document, helping you understand what contributes most to its total byte size.
Shows the UTF-8 encoded byte size of the JSON, which matches what is actually transmitted over HTTP. Useful for checking if your payload fits within API size limits or browser storage quotas.
Shows how much each key and value contributes to the total size, helping you identify which fields consume the most space and where optimization will have the greatest impact.
After identifying large fields, several strategies can meaningfully reduce your JSON size.
Identify keys that your client does not use and exclude them from the API response. Even removing a handful of verbose string fields can significantly reduce common endpoint payload sizes.
Long descriptive keys like user_display_name take more bytes than name. For high-volume APIs where the same key appears in thousands of records, shorter keys reduce total data transferred significantly.
Understanding where JSON bytes come from helps reduce API payload sizes, improve load times, and cut data transfer costs. A few fields often account for most of the size.
| Element | Size Impact |
|---|---|
| Key names | High — repeated in every object in arrays |
| Long string values | High — proportional to character count |
| Whitespace (pretty) | Medium — 30-50% of total size |
| Nested objects | Medium — structural overhead |
| Numbers | Low — compact representation |
| Booleans | Low — 4-5 characters (true/false) |
| null values | Low — 4 characters |
// 1. Shorten key names (for high-volume APIs)
{"firstName": "Alice"} → {"fn": "Alice"} // -7 bytes per record
// 2. Remove null values
{"name": "Alice", "email": null} → {"name": "Alice"} // -14 bytes
// 3. Use arrays instead of object arrays for tabular data
// Before:
[{"id":1,"score":95},{"id":2,"score":87}] // 42 bytes
// After (columnar):
{"ids":[1,2],"scores":[95,87]} // 30 bytes
// 4. Minify (remove whitespace)
JSON.stringify(data) // vs JSON.stringify(data, null, 2)
// Savings: ~45% for typical objects
| Format | Size | Reduction |
|---|---|---|
| Raw JSON | 1,000 KB | 0% |
| Minified JSON | 550 KB | 45% |
| Minified + gzip | 85 KB | 91.5% |
| Minified + brotli | 70 KB | 93% |
| MessagePack | 400 KB | 60% |
| Protobuf | 150 KB | 85% |
Understanding which parts of a JSON document account for the most bytes helps you target optimizations effectively. In large arrays of objects, key names are repeated on every element and often dominate total size more than the actual data values.
| Component | Size Impact | Optimization |
|---|---|---|
| Key names | High (repeated on every object in array) | Use short keys (id vs identifier) |
| String values | Variable | Truncate long strings, use codes |
| Whitespace | 10–30% of file | Minify for production |
| Nesting depth | Low | Flatten when possible |
| Array size | High | Paginate, limit fields |
| Duplicate data | High | Normalize / reference by ID |
| Number precision | Low | Round floats to needed precision |
| Null values | Low | Omit null fields with omitempty |
Setting a target size budget per endpoint type keeps APIs fast across all client devices and network conditions. These guidelines are widely used in mobile-first API design.
| API Response Type | Recommended Max Size | Notes |
|---|---|---|
| Mobile app list item | 1 KB per item | Fields needed for list view only |
| Mobile app detail page | 10 KB | Full object with related data |
| Web dashboard | 50 KB | Batch data, charts |
| Background sync | 500 KB | Paginated, delta updates preferred |
| File export | Unlimited | User-initiated, show progress |
const json = JSON.stringify(data);
const bytes = new TextEncoder().encode(json).length;
console.log(`${(bytes / 1024).toFixed(1)} KB`);
Explore more tools: All JSON Tools | Validator | Pretty Print | JSON Diff