What the errors mean
A JSON string starts and ends with a double quote, may not contain a raw line break or tab, and writes a double quote or backslash inside it as \" or \\. Break any of those rules and the parser reports one of: "Unterminated string in JSON at position N" (it reached the end of the text without finding the closing quote), "Bad control character in string literal in JSON at position N" (a raw newline or tab inside a string), or "Bad escaped character in JSON at position N" (a backslash followed by something that is not an escape). Python words them "Unterminated string starting at", "Invalid control character at" and "Invalid \escape".
The editor above opens on a string with a raw line break. Click Validate to see the line it reports.
Causes and fixes
Messages are from Node.js; Python's wording is given in brackets where it differs.
Missing closing quote
Error: Unterminated string in JSON at position 13 [Python: Unterminated string starting at: line 1 column 7 (char 6)]
Invalid
{"a": "hello}Fixed
{"a": "hello"}The string opened at "hello was never closed, so the parser read to the end of the text. Add the closing quote.
Raw line break inside a string
Error: Bad control character in string literal in JSON at position 12 [Python: Invalid control character at: line 1 column 13 (char 12)]
Invalid
{"a": "line1
line2"}Fixed
{"a": "line1\nline2"}Strings cannot span lines. Write the line break as the two characters \n. Tabs need \t. When you build the JSON in code, let json.dumps or JSON.stringify do the escaping.
Unescaped double quote inside a string
Error: Expected ',' or '}' after property value in JSON at position 12 [Python: Expecting ',' delimiter]
Invalid
{"a": "say "hi" now"}Fixed
{"a": "say \"hi\" now"}The second quote closes the string early, and the parser then finds hi where a comma should be. Escape quotes inside strings with a backslash.
Backslashes in a Windows path
Error: Bad escaped character in JSON at position 10 [Python: Invalid \escape: line 1 column 10 (char 9)]
Invalid
{"p": "C:\Users\ada"}Fixed
{"p": "C:\\Users\\ada"}A backslash starts an escape sequence, and \U is not one. Write each literal backslash as \\, or use forward slashes.
Truncated text
Error: Unterminated string in JSON at position 10
Invalid
{"a": "helFixed
{"a": "hello"}The text was cut off inside a string: a download that stopped early, a size limit, or a log line that truncates long values. Get the complete text.