15 chars · 1 line
Two-way sync · Edit either side and the other updates automatically.
[object Object]15 chars · 1 line
Two-way sync · Edit either side and the other updates automatically.
[object Object]JSON.parse runtime error
This error commonly means the value passed to JSON.parse is already a JavaScript object. Converting that object to text implicitly produces [object Object], so parsing stops at the first o instead of reading JSON syntax. This tool is free to use. No account or payment is required.
Last updated
JSON.parse expects a string containing JSON text. Passing an object can lead to string coercion before parsing, producing text such as [object Object] that is invalid from the first character.
If typeof value is object, fixing commas or quotes cannot solve the real problem. Remove the extra JSON.parse call or stringify only when you intentionally need JSON text.
The invalid text below represents what an object can become when coerced to a string before parsing.
[object Object]{"name":"Ada","active":true}Common questions
Because an object can be coerced to the string [object Object], and the o in object is not valid where JSON syntax is expected.
Usually no. If the value is already the object you need, use it directly. Stringify only when another part of the application specifically needs JSON text.
Inspect typeof value and the raw value immediately before JSON.parse. An object or array at that point indicates the parser is unnecessary.
Debugging a specific JSON issue? Browse JSON troubleshooting.