JSON Inspector
Analyze a JSON document's size, depth, type breakdown, and duplicate keys.
Entrada JSON
Estatísticas
Digite JSON à esquerda para ver suas estatísticas.
O que é JSON Inspector?
A JSON inspector analyzes a document's shape rather than its formatting — instead of re-indenting your JSON, it reports byte size, how deeply nested the structure goes, how many objects/arrays/keys it contains, a breakdown of value types (strings, numbers, booleans, nulls), and one thing a normal formatter can't show you at all: duplicate keys. JSON.parse() silently keeps only the last occurrence of a repeated key within an object, so a document with {"role": "user", "role": "admin"} parses without error and quietly discards the first value — a bug that's easy to introduce (hand-editing a large config, merging two payloads) and hard to notice until it causes confusing behavior downstream. This tool scans the raw text itself, not the parsed result, so it can flag those duplicates before they cost you a debugging session.
Como usar JSON Inspector
- Paste or type your JSON into the left panel.
- Stats update instantly on the right: size, depth, node counts, and a type breakdown.
- Check the "Duplicate keys" section — any key repeated within the same object is listed with its path and how many times it appears.
- Use the depth and node-count numbers to gauge whether a document is a good fit for the JSON to Table or Tree Viewer tools before diving in.
Exemplos
A document with a duplicate key
Entrada
{"user": {"role": "user", "role": "admin"}}
Saída
Duplicate keys: user.role appears 2× (parsed value silently keeps "admin")
Basic shape stats
Entrada
{"a": 1, "b": [1, 2, 3], "c": {"d": true}}
Saída
Objects: 2, Arrays: 1, Max depth: 2, Object keys: 4
Erros comuns
- Assuming valid, parseable JSON has no data-loss bugs — a document can parse perfectly fine while still silently dropping a duplicate key's first value.
- Confusing "total nodes" (every object, array, and primitive value counted once) with just the number of top-level keys.
- Not checking duplicate keys after merging two JSON payloads by hand, which is the most common way they get introduced.
Por que usar esta ferramenta
- Runs entirely in your browser — nothing you paste is uploaded anywhere.
- Catches duplicate-key bugs that are invisible in a normal parsed view, since JSON.parse already discarded the evidence by the time you'd see it.
- Gives you a quick sense of a document's size and shape before choosing which tool (Tree Viewer, Table, Formatter) is the right fit for exploring it further.