iGuideSmart

JSON & JavaScript String Escaper / Unescaper

Safely escape raw multiline text, quotes, tabs, and backslashes for JSON strings—or unescape escaped sequences. Runs locally in pure JavaScript with instant output, reference guide, and FAQs.

Formula & Calculation Logic

Eliminates manual backslash errors when embedding HTML snippets, regexes, or multiline prompts inside JSON payloads.

Primary Formula

Escape: JSON.stringify(raw).slice(1, -1) | Unescape: JSON.parse(`"${escaped}"`)

Example: Escape multiline quote snippet

  1. 1
    Escape newlines & double quotes
    Line 1\n"Line 2"
    Valid JSON string literal

JSON Escape Sequence Reference

Standard RFC 8259 string escapes.

Showing 4 of 4 reference values
JSON string escape sequence reference
Raw CharacterEscaped SequenceMeaning
"\"Double quote
\\\Backslash
Newline\nLine feed (LF)
Tab\tHorizontal tab

Practical Real-World Use Cases

Data Cleaning & Editorial Formatting

Transform lists, logs, and copy instantaneously without writing one-off scripts.

Private In-Browser Processing

Sensitive notes and drafts stay strictly in local browser memory.

JSON & JavaScript String Escaper / Unescaper – Frequently Asked Questions

Which characters must be escaped inside a JSON string?
Double quotes (\"), backslashes (\\), and control characters like newline (\n), carriage return (\r), and tab (\t).
Do I need to escape single quotes in JSON?
No—JSON strings are always delimited by double quotes, so single quotes remain unescaped.
Can I unescape an escaped log string back to readable lines?
Yes—switch to "Unescape" mode to turn \n and \" back into formatted text.
View all Text & Writing Tools →