Estimate JSON Size
About JSON Size Estimation
This tool calculates the byte size of JSON payloads using UTF-8 encoding. It's useful for optimizing API responses, checking payload limits, and understanding the impact of minification.
What the metrics mean
- Raw Size: The exact byte size of your JSON as entered, including whitespace
- Minified Size: Size after removing unnecessary whitespace (what you'd send over network)
- Gzip Estimate: Approximate size after compression (most servers use gzip)
Common payload limits
| Service | Limit |
|---|---|
| AWS API Gateway | 10 MB |
| Cloudflare Workers | 100 MB |
| Firebase Firestore (document) | 1 MB |
| MongoDB (document) | 16 MB |
| Express.js (default) | 100 KB |
Frequently Asked Questions
How is JSON size measured?
JSON size is measured in bytes using UTF-8 encoding. Each ASCII character is 1 byte, while non-ASCII characters (accented letters, CJK characters, emoji) use 2-4 bytes each.
What is the difference between raw and minified JSON size?
Raw size includes all whitespace (spaces, tabs, newlines) used for formatting. Minified size removes unnecessary whitespace while preserving the data. Minified JSON is what you should send over the network.
How much does gzip compress JSON?
JSON typically compresses to 10-30% of its minified size with gzip, depending on data repetitiveness. Payloads with repeated keys or similar values compress more. The estimate in this tool uses a heuristic based on character diversity.
What is the maximum JSON payload size for APIs?
It depends on the service. AWS API Gateway allows 10 MB, Firebase Firestore documents are limited to 1 MB, MongoDB documents to 16 MB, and Express.js defaults to 100 KB. Always check your specific platform limits.
Does minifying JSON change the data?
No. Minification only removes insignificant whitespace between tokens. The parsed data structure is identical. JSON parsers treat formatted and minified JSON the same way.
Is my JSON data sent to a server?
No. All size calculations happen in your browser using JavaScript. Your JSON data never leaves your device.
Why is my JSON larger than expected?
Common causes include long key names repeated across many objects, string values with escaped characters, deeply nested structures, and unnecessary precision in numbers. Consider shorter key names, removing unused fields, or using arrays instead of objects with numeric keys.
How do I reduce JSON payload size?
Minify before sending, enable gzip compression on your server, use short key names, remove null or empty fields, paginate large arrays, and consider binary formats like MessagePack or Protocol Buffers for internal APIs.
Related Tools
- JSON Formatter -- format and beautify JSON with customizable indentation.
- JSON Validator -- validate JSON syntax and structure.
- JSON to CSV Converter -- convert JSON arrays to CSV format.
- Binary File Size Calculator -- convert between decimal and binary storage units.
Privacy & Limitations
- All calculations run entirely in your browser -- nothing is sent to any server.
- Results are computed locally and should be verified for critical applications.
Related Tools
View all toolsBig-O Notation Visualizer
Interactive plot of O(1) through O(n!) complexity curves with operation count comparison
JSON Formatter
Format and beautify JSON with proper indentation
JSON Validator
Validate JSON syntax and show errors
CSV to JSON Converter
Convert CSV data to JSON format with auto-detection
JSON to CSV Converter
Convert JSON arrays to CSV format with nested object handling
JWT Decoder
Decode JWT tokens and display header and payload
JSON Size Estimator FAQ
How is JSON size measured?
JSON size is measured in bytes using UTF-8 encoding. Each ASCII character is 1 byte, while non-ASCII characters (accented letters, CJK characters, emoji) use 2-4 bytes each.
What is the difference between raw and minified JSON size?
Raw size includes all whitespace (spaces, tabs, newlines) used for formatting. Minified size removes unnecessary whitespace while preserving the data. Minified JSON is what you should send over the network.
How much does gzip compress JSON?
JSON typically compresses to 10-30% of its minified size with gzip, depending on data repetitiveness. Payloads with repeated keys or similar values compress more. The estimate in this tool uses a heuristic based on character diversity.
What is the maximum JSON payload size for APIs?
It depends on the service. AWS API Gateway allows 10 MB, Firebase Firestore documents are limited to 1 MB, MongoDB documents to 16 MB, and Express.js defaults to 100 KB. Always check your specific platform limits.
Does minifying JSON change the data?
No. Minification only removes insignificant whitespace between tokens. The parsed data structure is identical. JSON parsers treat formatted and minified JSON the same way.
Is my JSON data sent to a server?
No. All size calculations happen in your browser using JavaScript. Your JSON data never leaves your device.
Why is my JSON larger than expected?
Common causes include long key names repeated across many objects, string values with escaped characters, deeply nested structures, and unnecessary precision in numbers. Consider shorter key names, removing unused fields, or using arrays instead of objects with numeric keys.
How do I reduce JSON payload size?
Minify before sending, enable gzip compression on your server, use short key names, remove null or empty fields, paginate large arrays, and consider binary formats like MessagePack or Protocol Buffers for internal APIs.