Input — paste anything

Fix "Bad Control Character in JSON String" — Unescaped Newlines (RFC 8259)

RFC 8259 §7 prohibits literal control characters (U+0000–U+001F) inside JSON strings — newlines, tabs, and carriage returns must be escaped as \n, \t, \r. This error appears when user input, LLM output, or Windows line endings are embedded in JSON without escaping. Paste below and JSONBlitz fixes it automatically.

⚡ Auto-fixed issues see changes ↓
Ready — paste JSON or any text containing JSON
🌳
Tree view appears here after processing
Click nodes to copy JSONPath • Single-click a leaf to copy value
Formatted output appears here...
Process JSON to generate code...
Insights appear after processing
Shows what JSONBlitz changed to fix your JSON. Process some broken JSON first.
No changes recorded yet.
⌘↵ fix & copy   ⌘⇧V paste & fix   ⌘K actions   click copy value   dblclick copy path © 2026 JSONBlitz

Fix Unterminated String Literal in JSON — Detect and Close Open Strings

An unterminated string literal means the JSON parser found an opening quote character but reached the end of the input (or a newline) before finding the matching closing quote. This is one of the harder JSON errors to spot visually because the opening quote is present — only the closing one is missing, and the error message often points to a line far from where the actual problem is.

Common Causes

Accidentally deleting a closing quote while editing, a string value that contains a literal double quote that was not escaped with a backslash, a truncated API response that cuts off mid-string, and AI-generated JSON that forgets to close a long value are the most common sources of this error.

How JSONBlitz Fixes It

JSONBlitz uses the jsonrepair engine to trace the string structure, identify where the closing quote is missing, and insert it at the correct position. If the string contains an unescaped quote, that character is escaped instead. The Diff tab shows exactly what was changed.

Frequently Asked Questions

What does "unterminated string literal" mean?
A string was opened with a quote character but the parser reached the end of the input before finding the closing quote. The string is never properly finished.
Why does the error point to the wrong line?
Because the parser only knows the string is unterminated when it runs out of input — it reports the position where it gave up, not where the missing quote should be.
What if the string contains a quote character?
Quote characters inside JSON strings must be escaped as \". If your string contains a literal " that caused the problem, JSONBlitz will escape it rather than simply inserting a closing quote.
Recent Sessions