String Escaper
Type or paste raw text to escape it.
Paste raw text to turn special characters (newlines, tabs, quotes, and backslashes) into the escaped forms you need inside a JSON or JavaScript string literal, or flip the direction to turn an escaped string back into readable text. Everything runs in your browser, so nothing you paste leaves your machine. Invalid escape sequences are flagged clearly instead of being silently dropped.
How to use
- Choose a direction: Escape to turn raw text into a string literal, or Unescape to turn a literal back into raw text.
- Paste or type your text into the input box on the left.
- Read the converted result live in the output box on the right.
- Use Copy to grab the result, Swap to reverse the conversion, or Reset to start over.
Examples
- Escape: the two lines (Name:\tQuialo) followed by a newline become Name:\tQuialo\n with the tab and newline written as \t and \n.
- Escape: He said "hi" becomes He said \"hi\" so it fits inside double quotes.
- Unescape: C:\\Users\\me turns back into the path C:\Users\me.
FAQs
- Which escape sequences does it support?
- Escaping produces backslash, double quote, and the standard control shorthands (\n, \r, \t, \b, \f), with any other control character written as \uXXXX. Unescaping additionally accepts \/ , \xXX, and \uXXXX.
- What happens with an invalid escape on unescape?
- It stops and shows a clear message with the position, for example an unknown escape like \q, a dangling backslash at the end, or a \u sequence that does not have four hex digits. Nothing is silently dropped.
- Is my text sent to a server?
- No. The conversion runs entirely in your browser using local code, so the text you paste never leaves your device.
- Does this work for JSON strings?
- Yes. The escaped output uses the common overlap of JSON and JavaScript string rules, so it is safe to drop inside the quotes of a JSON value or a JavaScript literal.
- How do I reverse a conversion quickly?
- Press Swap. It feeds the current output back into the input and flips the direction, so you can confirm an escape round trips back to your original text.
Related tools
- Diff CheckerCompare two blocks of text and see what changed, line by line or word by word. Side by side, inline, or unified diff views. Free and private in your browser.
- XML FormatterPretty print XML with clean indentation per nesting level. Pick 2 spaces, 4 spaces, or tabs. Validates broken markup, runs in your browser.
- ASCII ConverterConvert text to ASCII or Unicode code points and back. Encode characters to decimal numbers or decode numbers to text in your browser.
- Cron Expression Builder and ExplainerBuild a cron expression with dropdowns, or paste one to get a plain English explanation and the next 5 run times. Supports 5 and 6 field cron.
- JSON FormatterFormat, validate, and beautify JSON in your browser. Paste messy JSON, get clean indented output, then copy it back. Free, no signup.
- Base64 EncoderEncode text to Base64 or decode Base64 back to text in your browser. Full UTF-8 support and clear errors on invalid input.