C# String Escape
Escape text for C# string literals, either regular strings with backslash escapes or verbatim @ strings with doubled quotes. Unescape them back too. Free.
Runs in your browser. Nothing is uploaded.
About C# String Escape
C# has two everyday string styles. Regular strings use backslash escapes (\n, \t, \", \\). Verbatim strings, written @"...", keep backslashes literally and only need a double quote written twice. Pick the style and paste the result straight into your code.
Verbatim mode is ideal for Windows paths and regular expressions. Unescape converts either style back to the plain text.
How to use C# String Escape
- Type or paste your text into the input box. Press Sample to see an example.
- Adjust the options. The result updates as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
When should I use a verbatim string?
When the text has many backslashes, such as file paths or regex patterns. @"C:\Data" is easier to read than "C:\\Data".
Does it support raw string literals?
C# 11 raw strings ("""...""") rarely need escaping at all, so they're not a separate mode.
Is C# String Escape free and private?
Yes. C# String Escape is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.