Escape / unescape JSON strings (no upload)
\\n / \\t, escape quotes as \\\", and validate locally.When you embed plain text into JSON, you often need a JSON string literal with the right escapes. This guide shows the safe way to escape and unescape strings without uploading private data.
What is a “JSON string literal”?
In JSON, a string is wrapped in double quotes and uses backslash escapes. Example:
"hello\\nworld". When parsed, it becomes a real newline between hello and
world.
Common breakages (and why JSON.parse fails)
- Raw newline inside quotes: JSON does not allow U+000A in a string.
- Raw tab inside quotes: JSON does not allow U+0009 in a string.
- Unescaped quotes: a
"must be written as\\\". - Backslashes: a literal
\\must be written as\\\\.
Quick examples
Bad (raw newline in a string):
{"msg":"line1
line2"}
Good (escape as \\n):
{"msg":"line1\\nline2"}
Good (tab as \\t):
{"cols":"a\\tb\\tc"}
Fast no-upload workflow
- Escape or unescape locally with JSON String Escape/Unescape.
- Validate the full JSON with JSON Validator (strict JSON only).
- If your JSON has comments or trailing commas, normalize it with JSON Repair.
Trust note: All processing happens locally in your browser. Files are never uploaded.
FAQ
Why does my JSON look fine in a log but fails to parse? Logs often print escape sequences. Your actual JSON might contain a real newline/tab character inside a quoted string, which breaks strict JSON.
Can I paste secrets here? This site runs client-side only. Still, prefer redacting tokens/passwords before sharing output in chats/issues.
Related by winning cluster
Linked from a winner family to push crawl and first-impression conversion.
Related by intent
Useful follow-up pages selected from real search impressions and no-click opportunities.
Next pages to check
Closest crawled pages without impressions yet. Added to speed first-impression conversion.