JSON Payload Size Analyzer
Find where the bytes go: per-key costs, depth, waste patterns and gzip size.
JSON payload
304 lines · 4,988 bytesProfile
252 nodesTop keys by bytes
| Path | Bytes | Share |
|---|---|---|
| $.rows | 2880 | 100.0% |
| $.rows[0].debug_trace | 20 | 0.7% |
| $.rows[1].debug_trace | 20 | 0.7% |
| $.rows[2].debug_trace | 20 | 0.7% |
| $.rows[3].debug_trace | 20 | 0.7% |
| $.rows[4].debug_trace | 20 | 0.7% |
| $.rows[5].debug_trace | 20 | 0.7% |
| $.rows[6].debug_trace | 20 | 0.7% |
Waste findings
- null field at $.rows[*].debug_trace — Consider omitting this field
- numeric string at $.rows[*].count — Quoted number
Recommendations
- Minify whitespace before transport (2.1 KB)
- Omit null field fields that carry no information (200 B)
- Send numbers as JSON numbers instead of strings (90 B)
Details
JSON Payload Size Analyzer walks a payload once to attribute serialized bytes to every key, compute a depth histogram and group repeated array shapes. A second pass finds suspicious patterns: numbers quoted as strings, base64 blobs, null or false padding, very long strings and possible duplicate keys in the raw text. Recommendations are ranked by potential savings. Gzip size is measured with the browser's native CompressionStream when available. Nothing is uploaded.
More examples
Row-heavy API response
{"rows":[{"id":1,"debug_trace":null}, ...]}Repeated shapes are grouped and null padding fields are ranked by byte cost.
Embedded image
{"avatar":"AAAA...300+ chars"}The base64 detector reports the blob and its estimated decoded size.
Numeric strings
{"count":"12345"}Quoted numbers are flagged with a recommendation to send JSON numbers.
Examples
Row-heavy response
50 rows with a null debug_trace and a stringified count$.rows[*].debug_trace — null field, ranked by savingsRepeated shapes group the rows and padding fields surface at the top.
Embedded avatar
{"avatar":"AAAA…"}base64 blob — about 225 decoded bytesThe tool recommends referencing an external asset instead.
Unicode payload
{"café":"😀"}UTF-8 byte counts, not character countsTextEncoder measures the bytes that would actually be transported.
About this tool
JSON Payload Size Analyzer attributes bytes to the keys that consume them. It reports raw and minified sizes, a depth histogram, repeated object shapes in arrays, and a ranked list of waste patterns with concrete recommendations.
Byte counts use UTF-8 encoding through TextEncoder, so non-ASCII text is measured as it would be on the wire. A single iterative walk keeps the analysis safe for deeply nested documents, and the gzip figure is measured with the browser's native CompressionStream when available rather than guessed.
Waste detectors flag numeric strings, long base64 blobs, null and false padding, very long strings and possible duplicate keys in the raw text. Duplicate detection is explicitly approximate because JSON.parse discards earlier values; the finding is labelled as possible.
What this tool does not do
- Input is capped at 10 MB; larger payloads are rejected before parsing.
- There is no drill-down tree for arbitrary subtrees in this version.
- Compare mode between two payloads is not implemented.
- Gzip falls back to an estimate when CompressionStream is unavailable.
- Brotli sizing is omitted because browsers do not expose a native encoder.
How to use this tool
Paste a payload
Use the sample or paste up to 10 MB of JSON into the input pane.
Read the summary
Compare raw, minified and gzip sizes, then check max depth and node count.
Inspect findings
Review top keys, repeated shapes and the ranked waste findings with their paths.
Apply recommendations
Copy the Markdown report to share the proposed reductions with your team.
Use cases
Shrinking REST responses
Identify which fields dominate a large response before changing the API.
Bandwidth budgets
See the gzip wire size to decide whether minification is worth doing.
API design guidelines
Show teams concrete examples of padding fields and quoted numbers.
Detected waste patterns
| Pattern | Meaning |
|---|---|
| numeric string | A value like 12345 sent as a quoted string |
| base64 blob | A 256+ character base64-like value with an estimated decoded size |
| null / false field | Padding values that cost key plus value bytes |
| long string | A string longer than 1000 characters |
| possible duplicate key | A key appearing more than once in raw text; last value wins |
Findings are grouped by pattern and normalized path so repeated array items roll up into one row.
Common mistakes
Mistake:Optimizing whitespace when gzip is already applied.
Fix:Read the gzip figure first; whitespace minification matters much less on the wire.
Mistake:Treating possible duplicate keys as certain.
Fix:Check the raw payload; JSON.parse keeps only the last value of a duplicate key.
Mistake:Counting string.length as bytes.
Fix:The analyzer uses UTF-8 byte length, which is what networks transport.
Mistake:Removing null fields that clients require.
Fix:Confirm the API contract before dropping fields the recommendation flags.
Mistake:Pasting JSON5 or JSON with comments.
Fix:Strict JSON is required; use a JSON5 tool to normalize it first.
Frequently asked questions
How is per-key size computed?
Each key's cost is the UTF-8 byte length of its serialized subtree plus the quoted key name and framing characters. Costs are sorted so the largest contributors appear first, and the share column compares each cost with the whole minified payload.
Is the gzip estimate real?
When the browser provides CompressionStream, the figure is the actual byte count of gzipping the minified payload. Otherwise a conservative estimate is shown and labelled as an estimate.
Does it upload my payload?
No. Parsing, byte accounting, shape detection and compression all happen in your browser tab. Nothing is sent to a server and nothing is persisted.
How are repeated structures detected?
Array elements that are objects are grouped by a signature of their sorted key set and depth. Arrays with the same signature are counted together so a homogeneous list of 30,000 rows appears as one row with a count.
What counts as waste?
Numbers sent as quoted strings, large base64 blobs, null or false padding fields, very long strings and possible duplicate keys. Each finding is ranked by the bytes it costs and paired with a concrete action.
Why does a duplicate key finding say possible?
JSON.parse silently keeps the last value for a duplicate key, so the parsed tree cannot prove duplication. The analyzer scans the raw text for repeated key names and labels the result accordingly.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.