Skip to main content
DevBench
\\

String Escape

DevOffline-ready

String Escape converts any text to an escaped version safe for use in JSON strings, JavaScript literals, SQL queries, and regular expressions — adding backslashes before quotes, newlines, and control characters as required by each format. Toggle between escape and unescape mode. Paste a raw string and copy the escaped version ready for code. Runs in your browser.

Related: AESHashUUIDHTML → JSX

String escaping

Escapes special characters in a string for safe embedding in different contexts. The wrong escaping (or missing escaping) causes syntax errors, broken output, or security vulnerabilities.