Unexpected token o in JSON at position 1

"[object Object]" is not valid JSON
(older engines: "Unexpected token o in JSON at position 1")

When a JavaScript object is coerced to a string without explicit serialization, it becomes the literal text "[object Object]". If that string is then passed to JSON.parse, the parser sees "[" — a valid array start — but immediately encounters "o" (from "object") at position 1, which is not a valid array element start. Node 20+ reports “"[object Object]" is not valid JSON”; older Chrome and Node 18 show "Unexpected token o in JSON at position 1". Both mean the same thing: you passed a stringified object placeholder instead of real JSON.

Passing an object directly to a string context

When template literals, string concatenation, or certain APIs coerce an object to a string, they call .toString() which returns "[object Object]". If you later parse that string as JSON, this error appears.

Invalid

const obj = { name: "Alice" }
const encoded = "data=" + obj        // "data=[object Object]"
const parsed = JSON.parse(encoded)   // throws

Valid

const obj = { name: "Alice" }
const encoded = JSON.stringify(obj)
const parsed = JSON.parse(encoded)

Fetching a resource that returns an object from a wrapper

Some API wrappers or middleware layers return a JavaScript object reference rather than a serialized string. If you have a double-parse or stringify-parse mismatch, the object gets coerced at some point in the chain.

Invalid

// Middleware returned the object, not the string
const raw = response.data  // already an object
JSON.parse(raw)            // coerces to "[object Object]"

Valid

// If it's already an object, no parsing needed
const data = response.data  // use directly

Incorrect FormData or URLSearchParams extraction

FormData.get() and URLSearchParams.get() return strings for known keys but return null for missing keys, and some code paths inadvertently pass the FormData object itself rather than a value from it.

Invalid

const form = new FormData(document.querySelector("form"))
JSON.parse(form)  // coerces to "[object Object]"

Valid

const form = new FormData(document.querySelector("form"))
const raw = form.get("json_field") as string
JSON.parse(raw)

Fix this error in seconds

Paste your JSON in the free validator to find the exact line and column where the error occurs.

Open JSON Validator →

Frequently Asked Questions

Why does position 1 appear in the error instead of 0?

The coerced string "[object Object]" starts with "[", which is a valid JSON array opener. The parser advances one character and reads "o", which is not a valid value start inside an array. That is why the error reports position 1 rather than 0.

How can I tell whether I have this problem before it throws?

Add a guard before parsing: if (typeof value !== "string") { console.error("Expected string, got:", typeof value, value) }. This reveals the object type and value before JSON.parse coerces it, making the bug immediately obvious in development.

More JSON errors