Choose Escape or Unescape, paste your text, pick the quote character, then click Convert and copy the result.
Escaping turns special characters — newlines, tabs, quotes, backslashes and control characters — into their JavaScript escape sequences so the text can be safely pasted inside a string literal.
Yes. Unescaping decodes \n, \t, \r, \b, \f, \v, \0, \xXX, \uXXXX and \u{...} back to the original characters, so escape then unescape returns your exact input.
Pick the quote you will wrap the string in. The escaper escapes only that quote character, leaving the other quote untouched for cleaner output.