JSON Structure Inspector
FormatEverything runs locally in your browser — nothing is uploaded
Paste JSON and get a picture of its shape: nesting depth, total nodes, how many objects and arrays, the type breakdown, the longest array and the longest string. The item most worth looking at is duplicate keys. `JSON.parse('{"a":1,"a":2}')` yields `{"a":2}` — the first `a` disappears without a word. In API work that is a real problem: a server writes the same field in two places, and two people looking at “the same JSON” reach different conclusions, each suspecting the other misread it. This tool scans the raw text to find them and reports where they are. Why this is a separate tool from the formatter: that one answers “how do I look at this JSON” (pretty-print, fold, edit), this one answers “what is this JSON” (how big, how deep, made of what). Same input, entirely different job and interface — statistics bolted onto an already button-dense editor would serve neither. The other three actions are recursive: shuffle, reverse and dedupe all reach every array at every level, not just the outermost one.
Features
- Nesting depth, total node count, number of objects and arrays
- Type breakdown (string × 12, number × 5 …), sorted by frequency
- The longest array, plus every array length listed
- Longest string length and total string length
- ⚠️ Duplicate keys: scans the raw text for repeated keys in one object, with path and count, and explains that JSON.parse keeps only the last
- Shuffle / reverse / dedupe, applied recursively to arrays at every level
- Dedupe compares values by their JSON text — `1` and `"1"` are different, two identical objects are not
- Parsing reuses the formatter’s error locator (line and column, and it recognises Python literals)
- Everything runs in the browser; nothing is uploaded
How to use
- Paste your JSON
- Leave the action on structure stats — the numbers appear immediately
- Look at the duplicate-keys row; it says “none” explicitly when there are none
- For tidying up, pick shuffle, reverse or dedupe to get formatted JSON back
FAQ
- Why do duplicate keys matter? The value my code reads looks right
- Because you are reading the last one. JSON.parse keeps the later value and discards the earlier, and the discard happens at parse time, not read time — so the value you get is “correct”, just not necessarily from the place you assume. The real trouble is collaborative: the server says it returned A, and A is indeed in the JSON you paste (its first occurrence), but your code receives the B that came later. This tool points at both, so you can discuss the same line.
- Why not just say JSON must not have duplicate keys?
- Because the spec does not forbid it — RFC 8259 leaves the behaviour to the implementation. Parsers disagree: JavaScript keeps the last, Python’s json keeps the last, and some strict parsers reject the document outright. The same file yielding different results in different languages is exactly what makes it dangerous. This tool does not judge; it states the facts.
- Where does the depth count start?
- The root counts as level 1, so `{"a":1}` has depth 2 (the root object plus the number) and `{"a":{"b":1}}` has depth 3. That makes depth mean “how many nodes you pass through from the root to the deepest value”, which is closer to intuition than counting brace levels.
- Is the shuffle cryptographically random?
- It uses `Math.random` and a Fisher–Yates shuffle. ⚠️ It deliberately does not use `crypto.getRandomValues`, because the goal is an unpredictable ordering of your data, not cryptographic strength. For unpredictable values (passwords, tokens), use the password generator or random number tools.
Related tools
JSON Formatter
FormatFormat, validate and minify JSON in a collapsible tree with syntax highlighting and line numbers. Search, edit, delete or convert to Python dicts.
JSON to Code
FormatTurn JSON into TypeScript interfaces, Go structs, Java classes or Rust structs, with missing keys marked optional. Runs locally in your browser.
JSONL Converter
FormatConvert JSONL (NDJSON) and JSON arrays both ways: parsed line by line with the failing line number reported, blank lines skipped, CRLF and BOM handled.
SQL Formatter
FormatFormat SQL online: one clause per line, consistent keyword case, subqueries indented deeper. Minify strips comments and extra whitespace, all locally.
JSON5 Converter
FormatParse JSON5 into strict JSON: comments, unquoted keys, single quotes, trailing commas, hex and Infinity all work, with errors located by line.
XML Formatter
FormatFormat XML online by tag level, with comments, CDATA and DOCTYPE on their own lines and attribute values left untouched. Runs locally in your browser.