JSON Tools
JSON Circular Reference Detector
Detect circular references in JavaScript objects before JSON.stringify fails.
Loading tool…
What is Circular Ref?
Scans a parsed JSON object for circular references (objects or arrays that reference themselves) and reports every circular path found.
How it works
The tool does a depth-first traversal of the object graph, tracking visited nodes in a Set. When a node is encountered twice, it reports the circular path.
- Paste JSON. Paste JSON data with potential circular references.
- Read results. A green badge means safe to stringify. Red lists every circular path found.
Examples
Circular object
An object where a.b.c = a detects and reports the cycle at path $.a.b.c.
Common mistakes
Not valid JSON
Circular references can't exist in pure JSON text — they only exist in parsed JS objects. The tool first JSON.parses the input which will fail on circular data.
Alternatives
JSON Validator
For syntax-level validation.
Frequently asked questions
Can it auto-fix circular references?
No — it only detects them. You need to restructure your data to remove cycles.