Skip to content
jsonforge.app

JSON Inspector

Analyze a JSON document's size, depth, type breakdown, and duplicate keys.

Masukan JSON

Loading editor…

Statistik

Masukkan JSON di sebelah kiri untuk melihat statistiknya.

Apa itu 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.

Cara menggunakan JSON Inspector

  1. Paste or type your JSON into the left panel.
  2. Stats update instantly on the right: size, depth, node counts, and a type breakdown.
  3. Check the "Duplicate keys" section — any key repeated within the same object is listed with its path and how many times it appears.
  4. 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.

Contoh

A document with a duplicate key

Masukan

{"user": {"role": "user", "role": "admin"}}

Keluaran

Duplicate keys: user.role appears 2× (parsed value silently keeps "admin")

Basic shape stats

Masukan

{"a": 1, "b": [1, 2, 3], "c": {"d": true}}

Keluaran

Objects: 2, Arrays: 1, Max depth: 2, Object keys: 4

Kesalahan umum

  • 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.

Mengapa menggunakan alat ini

  • 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.

Pertanyaan yang sering diajukan