.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

JSON Escape / Unescape

Turn text, JSON or XML into a JSON string literal, or unescape it back.

JSONTEXT
Open Tool

HTML Escape / Unescape

Encode < > & " ' as HTML entities, or decode entities back to text.

HTML
Open Tool

XML Escape / Unescape

Make text safe for XML elements and attributes, or decode it back.

XML
Open Tool

JavaScript Escape / Unescape

Turn text into a safe JS string literal, or unescape it back.

JavaScript
Open Tool

Java Escape / Unescape

Escape text for Java strings and .properties files, or unescape it.

Java
Open Tool

CSV Escape / Unescape

Quote a value correctly for CSV, or unwrap a quoted CSV field.

CSV
Open Tool

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

  1. Paste the text, or the escaped string.
  2. Press Escape or Unescape.
  3. 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.

Input
C:\Users\Asha\report.txt
Output
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.