String Escape / Unescape

Safely escape or unescape text for JSON, JavaScript and CSV — quotes, newlines, tabs and control characters handled correctly.

⚡ Runs entirely in your browser
Format
Direction

Nothing to convert yet — enter some text above.

How it works

Pick a format and a direction — the result updates as you type. No button to press.

1

Choose a format

JSON, JavaScript or CSV — each has its own escaping rules for quotes and special characters.

2

Escape or unescape

Escape turns raw text into a safe literal; unescape turns an escaped literal back into raw text.

3

Copy or download

Grab the output with one tap, or download it as a text file — nothing is ever uploaded.

What each format does

JSON escaping produces the inner content of a JSON string: backslashes, double quotes, newlines, tabs and control characters become \\, \", \n, \t and \uXXXX sequences. Unescaping reverses this, so you can read a value pulled straight out of a JSON payload.

JavaScript escaping targets a JS string literal. It escapes backslashes, single, double and back quotes, newlines, tabs and other control characters (including the line separators and that break inline scripts). Unescaping decodes \n, \t, \xHH, \uHHHH and \u{…} sequences back to plain text.

CSV escaping treats your text as a single field. If it contains a comma, double quote, or line break, the field is wrapped in double quotes and any inner quotes are doubled (" becomes "") per RFC 4180. Unescaping strips the wrapping quotes and collapses the doubled quotes back to one.

🔒

Private by design. Your text never leaves your device. All escaping happens right here in your browser — nothing is uploaded or stored.

Frequently Asked Questions

What's the difference between escaping and unescaping?
Escaping turns raw text into a safe literal — quotes, newlines and tabs become sequences like \", \n and \t. Unescaping reverses that, turning an escaped string back into plain, readable text.
Which formats can I escape for?
Three: JSON string content, JavaScript string literals, and CSV fields. Each has its own rules for handling quotes and special characters, and you pick the one you need with the toggle.
How does CSV escaping work?
Your text is treated as one field. If it contains a comma, quote or line break, the whole field is wrapped in double quotes and any inner quotes are doubled — the standard spreadsheet-safe format. Unescaping strips the wrapping quotes back off.
Does it handle newlines, tabs and accented characters?
Yes. Newlines, tabs, other control characters and Unicode (accents, symbols, emoji) are all handled correctly in every mode, in both directions.
Why does unescaping show an error?
Unescaping only works on text that's already validly escaped for the chosen format. A stray quote or an incomplete escape sequence will be flagged so you can fix the input.
Is my text uploaded anywhere?
No. Everything runs entirely in your browser — your text never leaves your device and nothing is uploaded or stored.