Escape or unescape developer string literals locally for JavaScript, JSON, and regex-safe text.
Plain Text
Edit raw text here to generate the escaped output below.
Escaped Output
Edit this pane to decode escaped content back into plain text above.
Mode Details
Escape text for a JavaScript string wrapped in double quotes.
Example
const message = "Hello\nWorld"
Validation
Escaped output updated
Plain length
40
Escaped length
45
How To Use
The top pane is always the plain text. The bottom pane is the escaped representation for the selected mode.
Use the JavaScript and JSON modes when you are preparing values for source code or payload literals. Use the regex mode when you need user-provided text to behave as a literal pattern instead of regex syntax.
You can edit either pane. When editing escaped output, the tool attempts to decode it back into plain text and shows an error if the current escaped value is invalid for the selected mode.