How to use the JSON Size Calculator
1. Paste any JSON value into the left panel.
2. The tool instantly calculates the size in bytes, both pretty-printed and minified.
3. Review depth, key count, and savings — then copy the minified version if needed.
What is it?
Understanding the size of a JSON payload is critical for API performance, storage budgeting, and network optimization. Large JSON payloads slow API responses, increase bandwidth costs, and hurt mobile performance. This tool gives you an immediate breakdown: pretty-printed size (what you write), minified size (what you ship), and the savings from minification.
The structural stats — nesting depth, key count, and value count — help you understand the complexity of the JSON. Very deep nesting (depth 10+) can indicate design issues; very high key counts in objects suggest you may benefit from arrays or compression. Use these numbers to guide API design decisions and data structure refactoring.
Example
{
"name": "Devy Tools",
"version": "1.0.0",
"active": true
}Pretty: 54 B Minified: 43 B Savings: 11 B (20.4%) Key Count: 3 Max Depth: 1
For large API responses, minification + gzip compression typically reduces payload size by 60–80%.
Benefits
Identify oversized API payloads before they cause timeouts
Know the exact byte count of a response or request body to diagnose slow API calls and gateway timeout issues.
Measure the benefit of minification before adding it to your pipeline
Compare formatted vs minified size here to decide whether a build-time minification step is worth adding.
Audit deeply nested structures that indicate design problems
High nesting depth and excessive key counts reveal objects that should be flattened, paginated, or split across endpoints.
Optimise payload size for mobile and low-bandwidth clients
Every kilobyte removed from a JSON payload improves load time for users on slow connections — measure before optimising.
Frequently asked questions
Why is the pretty-printed size larger?
Pretty-printed JSON includes whitespace — indentation spaces, newlines after each key-value pair, and spaces after colons and commas. This makes it human-readable but increases size. Minified JSON removes all unnecessary whitespace, making it smaller for network transfer.
Should I always minify JSON for production?
Yes — when transmitting JSON over a network (REST APIs, WebSockets), always minify. Most modern HTTP servers and CDNs also apply gzip or Brotli compression on top of minification, which further reduces sizes by 60–80% for typical JSON payloads.
What does nesting depth mean?
Nesting depth counts how many layers of objects or arrays are nested inside each other. A depth of 1 means all values are top-level. Each nested object or array adds 1 to the depth. Very deep nesting (5+) can make data hard to work with and may indicate a schema design issue.