.NET Unescape Online — Decode C#/VB Strings

Decode C# and VB.NET regular-string escape sequences (\n, \t, \", \\) back to their original characters. Browser-only — paste an escaped literal, copy plain text.

What is .NET String Unescaping?

.NET string unescaping reverses the backslash-escape transformation a C# regular string literal applies — turning \n back into a newline, \t into a tab, \" into a literal double quote, and \\ into a single backslash. The result is the actual character data the literal represents.

Engineers commonly need this when copying a string constant out of a .cs file for inspection, when debugging serialised content, or when comparing two strings that differ only in their escape representation. The OpenFormatter .NET unescape tool runs in your browser — paste the escaped body, click Unescape, copy the decoded result.

How to unescape .NET strings — 4 steps

  1. Paste the literal body. Drop the contents of a C# regular string (without the surrounding quotes) into the Input panel.
  2. Click Unescape. Each escape sequence is replaced with the character it represents in reverse order so doubled backslashes survive correctly.
  3. Verify line breaks. Multi-line content now displays across multiple physical lines; tabs and quotes appear as themselves.
  4. Copy plain text. The decoded output is the same string a running .NET program would see in memory.

Sample input and output

Escaped input

C:\\Users\\admin\\config.json\nHe said \"ready\" then pressed Enter\n\tTab-indented log line

Decoded output

C:\Users\admin\config.json
He said "ready" then pressed Enter
	Tab-indented log line

C# Escape Set

Decodes the regular-string set: \n, \r, \t, \b, \f, \", \\. The reverse of OpenFormatter's .NET escape tool — perfect round trip.

Order-Aware

Backslash collapse runs last so doubled backslashes survive every other replacement — paths and regex decode correctly.

Browser-Only

Decoding runs in JavaScript on your machine. Strings extracted from production C# code never leave the browser.

Common use cases

  • check_circleReading actual content of an escaped C# string constant
  • check_circleDebugging multi-line SQL stored as a single-line C# string
  • check_circleRecovering a Windows path from a C# regular-string file path
  • check_circleComparing two C# strings that differ only in escape representation
  • check_circleExtracting embedded JSON or XML out of a C# string fixture
  • check_circleInspecting log lines that show escape sequences instead of newlines
  • check_circlePulling the actual regex pattern out of a Regex.Match call site
  • check_circleVerifying round-trip behaviour between encoder and decoder pairs

.NET unescape vs Java unescape vs JSON parse

All three reverse a backslash-escape transformation. .NET unescape targets C# regular strings — the common control set plus \a/\v in C#-specific extensions. Java unescape handles the same common set plus \' for char literals and octal escapes. JSON parse follows RFC 8259, supporting only \", \\, \/, \b, \f, \n, \r, \t, and \u00xx — anything else is a syntax error. Decoding source between languages requires the right unescape pass.

Need to escape, or compare with other languages?

Re-encode plain text as a C# string with the .NET escape tool, or compare with Java and JavaScript unescape behaviour.

Frequently Asked Questions

Which escape sequences are decoded?

The unescape pass handles the most common C# regular-string escapes: \n (LF), \r (CR), \t (tab), \b (backspace), \f (form feed), \" (double quote), and \\ (backslash). It is intended for round-trip decoding of strings that the .NET escape tool produced.

How does the parser handle a verbatim @-string?

Verbatim strings (@"...") only escape one thing — a literal double quote is written as "". To unescape verbatim content you would collapse "" to " and leave backslashes alone. Paste a regular string body (without the @ prefix) into this tool; for verbatim, the only transformation needed is "" → ".

Does it decode \uXXXX Unicode escapes?

The current implementation focuses on the common control-character set. C# also supports \uXXXX (four-hex Unicode), \UXXXXXXXX (eight-hex Unicode), and \xN[N..] (variable-length hex) — for those, paste the literal already-decoded characters since modern .NET source files are UTF-8 and accept Unicode directly.

Why is \\ collapsed last?

The decode order is the reverse of the encode order. If \\ were collapsed first, the resulting single backslash could be re-interpreted by the next pass as the start of \n or \t. Doing it last guarantees that the doubled-backslash from the encoder safely survives every other replacement.

How is this different from the Java unescape tool?

The common escape sequences (\n, \t, \r, \b, \f, \", \\) are identical between Java and C#. Differences appear in the rare extras — Java has \' for single quote in char literals and supports octal escapes; C# adds \a (bell) and \v (vertical tab). For everyday strings the two unescape tools produce the same result.

Will it lose information on a malformed input?

A stray backslash followed by a non-escape letter (like \q) is left untouched. No characters are silently dropped; if you see something unexpected in the output, the cause is usually a missing escape that the encoder forgot to apply, not the unescape pass.

Can I use this for VB.NET strings?

VB.NET strings escape the double quote by doubling ("") and have no backslash escapes. To unescape VB strings, replace each "" with a single ". This tool decodes the C#-style backslash set, so it is not the right pass for raw VB.NET literals.

Is the input sent to a server?

No. The decode runs in JavaScript inside your browser. Strings copied from C# source — connection strings, query templates, secrets — never leave your machine. Verify in DevTools Network tab.

.NET Unescape Online — Decode C#/VB Strings