| Character | JS Escape | Unicode | Description |
|---|---|---|---|
| " | \" | \u0022 | Double quote |
| ' | \' | \u0027 | Single quote |
| ` | \` | \u0060 | Backtick (template literals) |
| \ | \\ | \u005C | Backslash |
| newline | \n | \u000A | Line feed |
| tab | \t | \u0009 | Horizontal tab |
| carriage return | \r | \u000D | Carriage return |
| vertical tab | \v | \u000B | Vertical tab |
JavaScript string escaping is the process of adding backslashes before special characters in JavaScript string literals to ensure they are interpreted correctly by the JavaScript engine. This is essential for web development when working with strings that contain quotes, backslashes, or control characters.
Why JavaScript string escaping is important:
JavaScript supports several escape sequences including \" for double quotes, \' for single quotes, \` for backticks, \\ for backslashes, \n for newlines, \t for tabs, and \uXXXX for Unicode characters. Modern JavaScript also supports template literals with ${} interpolation. Our tool handles all standard JavaScript escape sequences for both traditional strings and modern syntax.