Eliminates Manual Backslash Counting
Automatically escapes every backslash, quote, newline, and tab in your input — no more manually adding \\ before each backslash in a file path or regex.
500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.
Encode and decode JavaScript escape sequences for safe string handling.
JavaScript string escaping is a constant friction point when moving text between different contexts — copying a file path from Windows, embedding a SQL query inside a JS string, inserting a JSON value with quotes into source code, or preparing a string literal for a test fixture. A single unescaped backslash or quote breaks the string and causes a syntax error. JavaScript String Escape handles both directions: escape raw text so it is safe to embed inside a JavaScript string literal (adding backslashes before quotes, converting newlines to \n, backslashes to \\, and tabs to \t), and unescape a string literal that contains escape sequences back into the readable plain-text characters they represent. Supports standard JS escape sequences: \n, \r, \t, \\, \', \", \uXXXX (Unicode), \xXX (hex), and \0 (null). All operations run instantly in the browser.
Automatically escapes every backslash, quote, newline, and tab in your input — no more manually adding \\ before each backslash in a file path or regex.
Escape raw text for embedding in source code and unescape string literals to read their actual content — two operations in one tool without switching tabs.
Choose single-quote or double-quote target context so only the relevant delimiter is escaped, keeping the output as clean as possible.
Optionally converts non-ASCII characters (accented letters, emoji, CJK symbols) to \uXXXX sequences for embedding in ASCII-only JS files or JSON.
Prepare multiline SQL queries, file paths, regex patterns, or JSON payloads as escaped string literals ready to paste into unit test fixtures without syntax errors.
All processing happens in your browser — passwords, API keys, connection strings, and other sensitive values you need to escape never leave your device.
Input: C:\Users\alice\Documents\report.pdf
Output: C:\\Users\\alice\\Documents\\report.pdf
Input: SELECT id, name FROM users WHERE status = 'active' ORDER BY name ASC;
Output: SELECT id, name\nFROM users\nWHERE status = \'active\'\nORDER BY name ASC;
Input: Hello\tWorld\nLine 2: \"quoted value\"
Output: Hello World Line 2: "quoted value"