You paste some JSON, the parser says "Unexpected token at position 214", you look at position 214 and it seems fine. That's normal: the parser reports where it noticed the problem, which is often the character after the real mistake.
Here are the mistakes behind most invalid JSON, and what to look for.
1. Trailing comma
{ "name": "Asha", "age": 21, } JavaScript objects allow this; JSON does not. The parser only complains when it reaches the } and finds no property name, so the error points just past the comma. Delete the last comma.
2. Single quotes
{ 'name': 'Asha' } JSON only accepts double quotes, for both keys and string values.
3. Unquoted keys
{ name: "Asha" } Valid JavaScript, invalid JSON. Every key needs double quotes.
4. Comments
JSON has no // or /* */ comments. If you need notes in a config file, use a format that allows them (JSONC, YAML), or a "_comment" key.
5. Values JSON doesn't have
undefined, NaN, Infinity and functions are not JSON values. JSON.stringify quietly drops undefined properties and turns NaN into null, so a round trip can lose data without any error.
6. Unescaped characters inside strings
A raw line break or tab inside a string, or a Windows path like "C:\new" where \n turns into a newline. Escape backslashes as \\.
A quick way to find it
try { JSON.parse(text); } catch (e) { const pos = Number(e.message.match(/position (\d+)/)?.[1]); if (!Number.isNaN(pos)) console.log(text.slice(Math.max(0, pos - 40), pos + 10)); throw e; } Print the 40 characters before the reported position. The real mistake is almost always in there.
Disclosure: I run GoToolsOnline. I wrote up a longer table of the browser error messages and what each one usually means, with a validator that runs in your browser (it shows where JSON breaks; it doesn't auto-repair it): https://gotoolsonline.com/tools/fix-invalid-json


