100% local — your data never leaves your browser

C# Unescape — Read a Literal From Your Code

Decode a C# string literal back to text: the named escapes C# adds over Java, plus \uXXXX, \u{...} and \xNN, all turned back into characters.

Instant Private Zero cookies

.NET Escaped input

Text output

What this tool does

It reads the contents of a C# string literal and returns the text they stand for. It decodes the escapes C# recognises — \n, \r, \t, \b, \f, \v, \0 and \a — along with \uXXXX, the code point form \u{1F600} and the hex form \xNN. A surrogate pair written out as \ud83d\ude00 is recomposed into the one character it encodes.

Anything else after a backslash comes back as the bare character: \q gives q, \\ gives one backslash.

Where C# differs

\a and \v are the two escapes C# has that Java does not, which makes them a reliable signal that a literal came out of C# rather than Java. Both are decoded here: \a gives the bell character U+0007, \v the vertical tab U+000B. The difference runs the other way too: C# has no octal escape at all, where Java and JavaScript both do. \101 is A in those two and comes back here as the three characters 101, because in C# \0 is a named sequence and the 101 that follows is just text.

What it does not do

The eight-digit \U0001F600 form is not recognised and comes back as the literal text U0001F600; use \u{1F600} or the surrogate pair. \e is likewise returned as the letter e.

\u{1F600} is not C# syntax either. C# has \uXXXX and the eight-digit \UXXXXXXXX, and no brace form at all; it is accepted here for convenience, exactly as in the Java tool, but csc would reject it. On this one character the tool and the language disagree in both directions — it reads a form C# does not have, and does not read the form C# does.

\x is read as exactly two hex digits, whereas C# accepts one to four. \x4142 is one character in C# but comes back here as A42 — a genuine divergence, and a reason the variable-length form is discouraged in C# style guides in the first place.

Finally, it decodes one literal’s contents, not a C# expression: nothing is concatenated, interpolation holes are left as written, and verbatim strings should not be passed through it at all.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

What does C# decode that Java does not?
Two escapes: `\a`, the bell character U+0007, and `\v`, the vertical tab. Java has neither, so a literal that uses them is C#-specific.
Why is my `\U0001F600` untouched?
The eight-digit `\U` form is not recognised — it comes back as the literal text `U0001F600`. Write the emoji as `\u{1F600}` or as the surrogate pair `\ud83d\ude00` instead. The surrogate pair is the better choice: it is valid C# as well, whereas the brace form is not.
Does it work on a verbatim string?
No, and it should not. A verbatim string (`@"..."`) has no escape sequences at all: a backslash in one is just a backslash, so running it through here would corrupt the value.

Related converters