JSON Duplicate Key Detector

Find duplicate keys that JSON.parse silently swallows — with exact line and column numbers.

Tool input is processed locally in your browser and is not submitted to CodeNimbleTools. Avoid pasting production secrets into any device or website you do not fully trust.

Scan report

  

JavaScript's JSON.parse silently keeps only the last duplicate — this scanner reads the raw text, so it catches every duplicate before it disappears.

About this tool

Duplicate keys are legal-looking JSON that quietly destroys data: JSON.parse keeps only the last occurrence and drops the rest without a warning. This detector scans the raw text — not the parsed object — so it catches every duplicate before it disappears.

Each finding reports the object path plus the line and column of every occurrence.

How to use it

  1. Paste your JSON document.
  2. Click Run (the JSON must be syntactically valid).
  3. Review each duplicated key, its path, and all occurrence positions.
  4. Fix the source — remember only the last value survives parsing.

Useful ways to apply it

  • Debugging why a config value mysteriously ignores your edit (an earlier duplicate is being overridden).
  • Validating hand-merged JSON files after conflict resolution.
  • Linting API payloads produced by string concatenation.
  • Checking translation files where duplicate keys hide missing strings.

Worked example

Example input

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

Expected output

Duplicate key: role

Edge cases to check

  • Duplicate detection must occur before normal JSON parsing because parsers may keep only one value.
  • Escaped key text and nested objects must be tracked independently.

Known limitations

A duplicate-key warning identifies an interoperability risk; different parsers may handle duplicate names differently.

How this tool was reviewed

Reviewed with root and nested duplicates, escaped keys and valid control samples.

Last reviewed: September 3, 2026 · Maintainer: William

Standards and technical references

Frequently asked questions

Why doesn't JSON.parse error on duplicates?
The JSON spec says names should be unique but parsers are not required to reject duplicates. JavaScript keeps the last one; some parsers keep the first. Either way, data is lost silently.
Does it check duplicates across different objects?
No — duplicates only matter within the same object. The same key in two different objects is perfectly fine and not reported.
My file is huge. Will it work?
Yes — the scanner is a single pass over the text and handles multi-megabyte documents quickly.

Privacy

Tool input is processed locally in your browser and is not submitted to CodeNimbleTools. Avoid pasting production secrets into any device or website you do not fully trust.