1. A multi-line string pasted into a value
Pasting an address, a SQL query or a stack trace into a JSON string keeps its line breaks. Replace each line break with \n, or press Repair to escape them all.
JavaScript and Python JSON parsers
JSON strings can't contain raw control characters such as a real line break or tab. They must be written as escape sequences like \n and \t. The parser found one typed directly inside a string.
The body string has real line breaks and a tab inside it. Press Repair to escape them.
{
"title": "Release notes",
"body": "Fixed the login bug
Added dark mode
and a settings page"
}
Pasting an address, a SQL query or a stack trace into a JSON string keeps its line breaks. Replace each line break with \n, or press Repair to escape them all.
Inserting user input or file contents into a JSON template by hand skips the escaping. JSON.stringify and json.dumps escape control characters for you.
import json
note = "line one\nline two"
payload = json.dumps({"note": note}) # writes "line one\\nline two"Python's json.loads(text, strict=False) accepts raw control characters inside strings. It's handy for reading messy data you don't control, but the JSON is still invalid for every other parser.
Double quotes, backslashes and every control character from U+0000 to U+001F. The common ones have short forms like \n, \t and \r, and the rest are written as \u0000 style escapes.
Write it as \n inside the string. When the JSON is parsed it becomes a real line break in the resulting value.