Input — paste anything

Fix "Unexpected Token o in JSON at Position 1" — [object Object] Error

This error means JSON.parse() received the string [object Object] instead of actual JSON. It happens when a JavaScript object is passed directly to JSON.parse() — the object gets converted to its string representation first, which is literally [object Object]. The fix is to use JSON.stringify() first, or to access the already-parsed object directly without parsing it again.

⚡ Auto-fixed issues see changes ↓
Ready — paste JSON or any text containing JSON
🌳
Tree view appears here after processing
Click nodes to copy JSONPath • Single-click a leaf to copy value
Formatted output appears here...
Process JSON to generate code...
Insights appear after processing
Shows what JSONBlitz changed to fix your JSON. Process some broken JSON first.
No changes recorded yet.
⌘↵ fix & copy   ⌘⇧V paste & fix   ⌘K actions   click copy value   dblclick copy path © 2026 JSONBlitz

Fix "Unexpected Token o in JSON at Position 1" — The [object Object] Problem

"Unexpected token o in JSON at position 1" is caused by calling JSON.parse() on a JavaScript object rather than a string. When an object is coerced to a string, JavaScript produces "[object Object]". JSON.parse() then tries to parse that literal string and immediately fails at the "o" character (position 1, after the "[").

Why This Happens

The most common cause is double-parsing: data comes back from an API already parsed (as a JavaScript object), and then the code calls JSON.parse() on it again unnecessarily. Another common cause is using string concatenation or template literals with an object, which triggers the toString() conversion. A third cause is passing response.text() output through fetch() and then calling JSON.parse() on the already-stringified result after it has been coerced somewhere in the chain.

The Fix in Your Code

If using fetch(): use response.json() instead of response.text(). If you have an object and need a JSON string: use JSON.stringify(obj). If you received a string and need an object: call JSON.parse() once only. If you are unsure whether something is already parsed: check typeof data — if it is "object" already, do not parse it again.

Frequently Asked Questions

What does "unexpected token o in JSON at position 1" mean?
JSON.parse() received the string "[object Object]" — the default string representation of a JavaScript object — instead of a valid JSON string. The parser fails at the "o" which is at position 1 inside "[object Object]".
How do I fix it in my code?
If using fetch(), replace response.text() with response.json(). If you have an object you want to serialise, use JSON.stringify(obj) rather than passing the object to JSON.parse(). If the data is already an object, use it directly without parsing.
Can JSONBlitz fix [object Object]?
JSONBlitz cannot recover the original object from [object Object] — that information is gone. But if you paste the original JSON string or the object output before it was coerced, JSONBlitz can validate, format, and repair it.
Recent Sessions