Escape or unescape a string, privately
Turn any text into a safe JSON/code string literal — escaping quotes, backslashes, newlines and tabs — or reverse an escaped string back to the original. Everything runs on your device: 0 uploads, works offline, so your text, tokens and secrets never touch a server.
How to use it
- Paste your text into the box.
- Pick Escape to convert it into a string-literal body —
"\newline (\n), tab (\t), carriage return (\r) and control chars get backslash-escaped — or Unescape to turn\n,\t,\uXXXXand friends back into real characters. - The result updates live. No surrounding quotes are added, so you can drop the escaped text straight between the
"marks in your JSON, JS/TS or config file. - Copy the output, or switch modes to roundtrip it and check your work.
FAQ
How do I escape a string for JSON or code?
Paste the raw text and choose Escape. It backslash-escapes double quotes, backslashes, newlines (\n), tabs (\t), carriage returns (\r) and other control characters — exactly what a JSON or JavaScript/TypeScript string literal needs. The output is the literal body with no surrounding quotes, so you paste it between your own " marks. It's all built in your browser, so nothing is uploaded and there's no sign-up.
How do I unescape a JSON or code string?
Choose Unescape and paste text that contains escape sequences like \n, \t, \", \\ or \u0041. Each sequence is turned back into the character it stands for — \u0041 becomes A — giving you the original text. Paste the body only; leave off the surrounding quotes.
Is my text uploaded or stored anywhere?
No. The escaping and unescaping run entirely on your device and nothing is saved — that's the point. You can paste API tokens, keys or private strings and turn your Wi-Fi off; it still works.
What characters get escaped?
Double quote (" → \"), backslash (\ → \\), newline (\n), tab (\t), carriage return (\r) and other control characters (as \uXXXX). Ordinary letters, digits, punctuation and Unicode like ₹ are left as-is.
Why doesn't the escaped output have quotes around it?
So you can drop it straight into your own string literal. The tool gives you the contents that go between the quotes; you add the opening and closing " (or ', or backticks) in your file.
Limits
Uses JSON string-escaping rules, which also cover JavaScript, TypeScript and most C-style languages. It does not do HTML entity encoding, URL percent-encoding, or shell/CSV quoting — those are different escaping schemes with their own tools. Unescape expects a valid string body: a lone backslash or an incomplete \u escape is reported as a typed error rather than guessed at.
Related
The JSON formatter pairs naturally when you're wrangling escaped JSON, and the other text utilities handle case, whitespace and encoding once they're live.
Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.