String Escape / Unescape
Escape or unescape special characters like \n, \t, and \".
\nNewline\tTab\rCarriage return\\Backslash\"Double quote\'Single quote\0Null character\bBackspaceAbout this tool
Escape sequences allow special characters to be represented inside string literals. The backslash serves as an escape character, giving the next character a different meaning: \n is a newline, \t is a tab, \r is a carriage return, \\ is a literal backslash, and \" is a double quote inside a double-quoted string. These sequences are defined by the language or format, not by any universal standard.
The need for escaping arises because programming languages use these characters as delimiters or control characters in source code. Pasting multi-line text directly into a string literal breaks the code. When receiving a string from an API or database that contains escape sequences, you may need to unescape it to see the actual characters.
Common scenarios where escaping matters: embedding JSON in shell commands (requires escaping quotes), writing string literals in JavaScript or Python source code, debugging strings from APIs that arrive over-escaped, working with regular expressions that use backslash for their own escape sequences, and handling Windows file paths (where backslashes in paths conflict with escape sequences).