Tool Workspace
Enter content, process with one click
1Introduction
In JavaScript, strings may contain special characters like quotes, newlines, and backslashes, which can cause syntax errors if used directly. This tool can escape strings so they can be safely embedded in code, and also unescape escaped strings back to the original text. Simply input a string, select escape or unescape mode, and click the button to get the result. The escaped string can be directly used in JavaScript string literals.
2How to Use
Enter String
Enter the string to escape or unescape in the input box.
Select Mode
Select 'Escape' or 'Unescape' mode.
Click Execute
Click the 'Execute' button to get the result.
Copy Result
Copy the escaped string for use in code.
3FAQ
What is the difference between escaping and unescaping?
Escaping converts special characters into escape sequences, such as converting a newline to \n; unescaping restores the escape sequences back to the actual characters.
Which escape characters are supported?
Supports common escape characters such as single quotes, double quotes, backslashes, newlines, carriage returns, tabs, etc.