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.
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
- Paste your JSON document.
- Click Run (the JSON must be syntactically valid).
- Review each duplicated key, its path, and all occurrence positions.
- 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.
Standards and technical references
See the site-wide testing methodology for fixture categories, privacy checks and correction policy.
Frequently asked questions
Why doesn't JSON.parse error on duplicates?
Does it check duplicates across different objects?
My file is huge. Will it work?
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.