.NET Escape / Unescape
Escape text for a regular C# or VB.NET string literal (quotes, backslashes, new lines, \uXXXX for non-ASCII), or unescape it back to plain text — in your browser.
Suggested tools
About .NET Escape / Unescape
.NET Escape converts text into a valid C# or VB.NET regular string literal. Backslashes, double and single quotes, new lines, tabs and other control characters become escape sequences (\\, \", \n, \t), and characters outside basic ASCII are written as \uXXXX so the source file stays ASCII-safe.
Unescape turns an escaped string — for example copied from a log, a debugger or a JSON payload — back into readable text, understanding \uXXXX, \xXX and the usual backslash escapes. Everything runs locally in your browser — the text you paste is never uploaded.
How to use .NET Escape / Unescape
- Paste the text, or the escaped string.
- Press Escape or Unescape.
- Copy the result into your code or document.
Key features
- Escapes \ " ' and control characters
- Non-ASCII characters written as \uXXXX
- Unescape understands \uXXXX, \xXX, \n, \t and more
- Escape and Unescape on one page
Example
Backslashes in a Windows path are doubled for a regular C# string.
C:\Users\Asha\report.txt
C:\\Users\\Asha\\report.txt
When to use .NET Escape / Unescape
- Pasting a Windows path or multi-line text into C# code.
- Reading escaped strings from .NET logs or exception messages.
- Preparing test data containing quotes for unit tests.
Tips and common problems
- For file paths, a verbatim string (@"C:\folder") may be simpler than escaping every backslash.
- Non-ASCII characters become \u escapes, which keeps source files encoding-safe.
- Unescape treats \x and \u sequences — useful for reading logged strings.
Frequently asked questions
A verbatim string only needs quotes doubled ("") and keeps backslashes as they are — handy for Windows paths. Use this tool when you need a normal string literal.
Writing non-ASCII characters as Unicode escapes avoids encoding problems in source files. C# reads \u20b9 as the same ₹ character.
Very close — both use backslash escapes and \uXXXX. The Java Escape tool produces the same result.