Skip to content
jsonforge.app

JSON Analyzer & Statistics

Analyze JSON structure with detailed statistics: total keys, objects, arrays, max depth, duplicate keys, nullable fields, data types, memory, and payload size.

JSON Input Document

Total Keys

21

Objects / Arrays

6 obj / 3 arr

Max Nesting Depth

6 levels

Estimated Memory

2.46 KB

Payload: 857 Bytes

Data Types Breakdown

Strings14 (51.9%)
Numbers2 (7.4%)
Booleans1 (3.7%)
Null Values1 (3.7%)
Objects6 (22.2%)
Arrays3 (11.1%)

Structural Health & Edge Cases

Nullable / Null Fields

1

Empty Objs / Arrays

1 obj / 1 arr

Duplicate Keys (0):

No duplicate keys across objects.

Biggest Object ($.data.user):9 keys
Longest String ($.data.user.profile.bio):94 chars

What is JSON Analyzer & Statistics?

JSON Analyzer & Statistics runs a single recursive traversal over your parsed JSON and reports on its shape: total key count, number of objects vs. arrays, maximum nesting depth, and a full data-type breakdown (strings, numbers, booleans, nulls, objects, arrays) as a share of every node in the tree. It also flags the edge cases that tend to hide bugs — nullable fields, empty objects, empty arrays, and a key name that repeats anywhere in the document, even across unrelated sibling objects rather than just within one — and calls out the single largest object by property count and the longest string value, each annotated with the exact path back to where it lives, like `data.user.profile.bio`. Two size figures are reported side by side and are easy to conflate: payload size is the raw UTF-8 byte length of the text you pasted, while estimated memory footprint is a heuristic modeled on how the V8 engine actually allocates strings, numbers, arrays, and object shapes in memory — useful for judging whether a large response will strain a memory-constrained client, not just the network. Everything runs synchronously in your browser tab through one traversal function; nothing is uploaded, and there's no external AST or schema library involved.

How to use JSON Analyzer & Statistics

  1. Paste your JSON document into the input editor, or upload a .json file.
  2. The summary panel updates instantly with total keys, max depth, estimated memory, and payload size.
  3. The data-type breakdown shows what share of every node is a string, number, boolean, null, object, or array.
  4. Below that, check duplicate key names, nullable fields, empty objects/arrays, the biggest object, and the longest string — each with the path to where it occurs.

Examples

Analyze Nested User Payload

Input

{"user":{"id":101,"name":"Alice","roles":["admin"],"meta":{}}}

Output

Reports: 4 Keys, 2 Objects, 1 Array, 1 Empty Object, Max Depth: 3, Payload: ~60 Bytes.

Detect Duplicate Keys Across Objects

Input

{"a":{"id":1},"b":{"id":2}}

Output

Reports: Duplicate Key 'id' occurring 2 times across objects.

Flagging a long string field

Input

{"user":{"profile":{"bio":"Senior Software Engineer and Open Source advocate specializing in scalable cloud architecture."}}}

Output

Reports: Longest String at path 'user.profile.bio', 105 chars — surfaced even though it's nested three levels deep.

Common mistakes

  • Pasting malformed JSON with missing quotes or trailing commas, which fails initial syntax parsing.
  • Confusing raw HTTP network payload byte size with V8 JavaScript in-memory heap object footprint.
  • Assuming duplicate keys within a single object are valid JSON (JSON standards recommend unique keys per object level).
  • Reading 'Max Nesting Depth' in isolation as a performance red flag — a depth of 10 with small objects is harmless; it only matters combined with a high Total Keys count or a large payload size.
  • Assuming the reported 'Longest String' is human-readable — for a base64-encoded image or a JWT stored as a string value, the tool measures length correctly, but the value itself won't be meaningful text.

Why use this tool

  • Reports the whole document's shape in one pass — key counts, depth, type breakdown, and size — instead of eyeballing an indented tree to estimate the same things.
  • Surfaces empty objects, empty arrays, and null fields at any depth, which are easy to miss scrolling through a large formatted document by hand.
  • Runs entirely client-side, which is what makes analyzing a real production payload trustworthy in the first place.
  • Every structural metric — duplicate keys, biggest object, longest string — includes the JSON path back to where it occurs, so you don't have to hunt for it manually.

Frequently asked questions