Escape or unescape common JavaScript string characters including quotes, slashes, tabs and line breaks.
ToolsFaction Online Tool
JavaScript String Escape & Unescape
Transform common JavaScript string escape sequences.
About This Tool
ToolsFaction JavaScript String Escape Tool performs practical text escaping for common JavaScript string characters. It is intended as a lightweight developer utility, not a JavaScript parser.
How to Use
Paste text into the input.
Choose Escape String or Unescape String.
Review the output.
Copy the transformed text into your code as appropriate.
Example
Escape line breaks and quotes before placing text inside a JavaScript string.
Frequently Asked Questions
Does it execute JavaScript?
No.
Which characters are handled?
Common backslashes, quotes, tabs, carriage returns and newlines.