JJSONForge
Get JSONForge

JsonForge · JSON errors

Bad control character in string literal in JSON

A raw newline inside a string. Control characters below U+0020 must be escaped.

The smallest input that causes it

{"a": "line1
line2"}

JSON.parse on that gives, verbatim:

Bad control character in string literal in JSON at position 12 (line 1 column 13)

The fix

{"a": "line1\nline2"}

That version parses.

Find it in your own document

Paste the JSON and get the error located by line and column, the document formatted, a schema inferred from it, and a diff against another version.

Open JsonForge

Other JSON errors