JSON Size Analyzer

JSON Tools

How to use the JSON Size Analyzer

Analyze your JSON payload size breakdown:

1

Paste your JSON

Paste any JSON object or array — minified or pretty-printed. Size is measured from the actual content, independent of formatting whitespace.

2

Click Analyze

Get a table showing each key, its value type, byte size, and percentage of total payload with a visual bar.

3

Sort by size

Click the Size column to sort descending and instantly see the largest fields at the top. This identifies your optimization targets quickly.

4

Drill down or limit depth

Set a max depth to focus on top-level fields first, or expand to see the full nested breakdown.

5

Optimize

Use the insights to shorten key names, remove unused fields, move large blobs to CDN URLs, or restructure the data. Re-paste optimized JSON to compare the new total size.


When to use this tool

Use this when you need to understand and optimize your JSON payload size:

  • Profiling an API response to identify which fields are contributing most to payload size before an optimization sprint
  • Finding unexpectedly large embedded values (base64 images, long strings, large arrays) in a JSON response
  • Optimizing mobile app API responses where bandwidth and data transfer costs are constrained
  • Deciding which fields to remove, abbreviate, or move to a separate endpoint to reduce response size
  • Auditing third-party API responses to understand their payload composition before caching or storing
  • Comparing JSON payload sizes before and after an optimization to quantify improvements
  • Identifying fields where abbreviated key names (e.g. desc instead of description) would significantly reduce size at scale

Frequently asked questions

Q:How is the byte size calculated for each field?
Size is calculated as the UTF-8 byte length of each key name, its serialized value (including any nested structure), and the associated JSON structural characters (quotes, colon, comma). This matches the actual bytes transmitted over the network for that field. UTF-8 encoding means ASCII characters are 1 byte each; most Unicode characters are 2–4 bytes.
Q:What is the most common cause of unexpectedly large JSON payloads?
The most common culprits are: Base64-encoded images or binary files embedded directly in the JSON (these should be served from a CDN as URLs instead), very long description or body text fields, large nested arrays of objects with repetitive structure, redundant fields that are returned but never used by the client, and verbose key names that add up in large arrays (e.g. description repeated 1000 times in an array).
Q:Does the size account for gzip or Brotli compression?
The analyzer shows the raw uncompressed byte count. In practice, HTTP responses are usually compressed with gzip or Brotli, which can reduce JSON payload size by 70–90%. However, the relative size breakdown between fields is still accurate and useful for optimization — large fields before compression are large after compression too. Use raw sizes to compare fields against each other, not to predict actual transfer sizes.
Q:Can I analyze minified JSON?
Yes — the analyzer works on both pretty-printed and minified JSON. The size it reports is based on the actual characters in each field's key and value, not the whitespace formatting. So minified and pretty-printed JSON of the same data will show the same per-field breakdown (whitespace is not attributed to any specific field).
Q:How much does key name length affect payload size at scale?
Key name length matters significantly in large arrays. If you have 10,000 objects each with a key called description (11 bytes), the key names alone add 110,000 bytes (107 KB) to your payload. Shortening it to desc (4 bytes) saves 70,000 bytes (68 KB) before compression. The size analyzer helps you identify which keys appear frequently enough for abbreviation to have a meaningful impact.
Q:Is my JSON data sent to a server?
No. All size analysis runs entirely in your browser using JavaScript's TextEncoder API to measure byte lengths. No data is transmitted, logged, or stored anywhere. You can safely analyze real API responses and production JSON payloads.