C#/.NET Unescape
Paste an escaped C# string literal and instantly get back the real, decoded text.
Example
Input (an escaped C# string literal):
Hello\tWorld\nPath: C:\\Users\\dev\nUnicode: café \U0001F600
Output (decoded text):
Hello World
Path: C:\Users\dev
Unicode: café 😀
How it works
Each backslash escape sequence (\n, \t, \", \\, \uXXXX, \UXXXXXXXX, \xH..H, \0, \a, \b, \f, \v, \r) is replaced with the character it represents. Unknown or incomplete sequences are passed through unchanged.
Good to know
C#/.NET Unescape takes an escaped string literal — the kind you copy out of C# source code, a serialized config value, or a log line — and converts every backslash escape sequence back into the actual character it represents. Paste something like Hello\tWorld\nUnicode: café into the input box and you instantly get the real tab, newline, and accented "é" in the output. It is built for .NET developers and anyone who has to read or debug strings that were stored or printed in their escaped, source-code form.
Reach for it when a string is hard to read because the whitespace and special characters are still written out as \n, \t, or \uXXXX. Common moments: inspecting an exception message captured in a log, sanity-checking a value pulled from JSON or a database that was double-escaped, recovering the literal text of a regex or file path, or turning a Unicode code point like \U0001F600 back into the emoji it actually encodes so you can confirm what a string contains.
To read the result, compare the output pane to your input: the status line reports how many escape sequences it decoded, which is a quick sanity check that the tool recognized what you expected. The decoder understands the full set of C# escapes:
- Simple escapes
\n \t \r \0 \a \b \f \v \" \' \\, fixed-width \uXXXX (UTF-16) and \UXXXXXXXX (a full Unicode code point), and variable-length \xH through \xHHHH hex.
One caveat worth knowing: the variable-length \xH..H form is genuinely ambiguous in C# because it greedily consumes 1 to 4 hex digits, so a sequence like \x41B may decode differently than you intend if the following text happens to be a hex digit — prefer the fixed-width \uXXXX form in your own code. Also, anything the decoder doesn't recognize (a trailing lone backslash, or \u with too few digits) is passed through untouched rather than dropped, so nothing in your input is silently lost.
Frequently asked questions
Which C# escape sequences are supported?
All standard C# escapes: \n \t \r \0 \a \b \f \v \" \' \\, plus \uXXXX (UTF-16), \UXXXXXXXX (full Unicode code point), and \xH to \xHHHH (variable-length hex).
What happens to invalid or incomplete escapes?
They are left untouched. For example a stray backslash at the end of the string, or \u with fewer than 4 hex digits, is passed through verbatim so you never lose data.
Is my data uploaded anywhere?
No — this tool runs entirely in your browser. Your input never leaves your device and it works offline once loaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the difference between escaping and unescaping a C# string?
Escaping converts real characters (like a newline or a quote) into backslash sequences such as \n or \" so the text is safe inside a source-code literal. Unescaping reverses that, turning the sequences back into the actual characters. This tool performs the unescape direction.
What does \uXXXX mean in a C# string versus \UXXXXXXXX?
\uXXXX is a 4-hex-digit UTF-16 escape that represents a single 16-bit code unit, so characters outside the Basic Multilingual Plane need a surrogate pair. \UXXXXXXXX uses 8 hex digits to encode a full Unicode code point directly, including emoji and other supplementary-plane characters.
How do I decode a Unicode escape sequence to an emoji?
Paste the escaped form such as \U0001F600 into the input, and the tool outputs the corresponding character (😀). \U handles the full code point in one sequence, which is the reliable way to represent emoji that fall outside the 16-bit range.
Why is \xHH in C# considered risky or ambiguous?
The \x hex escape is variable-length: it consumes between one and four hex digits. If the character right after your intended value is also a valid hex digit, it gets absorbed into the escape, changing the result. Fixed-width \uXXXX avoids this ambiguity.
Can I unescape a string copied from a JSON value or log file?
Often yes, because JSON and C# share many escapes like \n, \t, \" and \uXXXX. However, JSON does not support \xHH or \UXXXXXXXX, and C# verbatim strings (the @"..." form) do not use backslash escapes at all, so check the source format before relying on the output.
What is a verbatim string in C# and does it use escapes?
A verbatim string is written with an @ prefix, like @"C:\Users", and treats backslashes literally rather than as escape characters. Because it does not interpret escapes, a verbatim literal generally does not need unescaping; only ordinary (non-verbatim) literals do.
Does this tool change anything if my text has no escape sequences?
No. Plain text with no backslash sequences passes through unchanged, and the status line will report that zero escape sequences were decoded. Only recognized backslash sequences are transformed.
Will decoding a string here remove or break characters I want to keep?
No characters are dropped. Recognized escapes are converted, and anything unrecognized or incomplete is left exactly as written, so your original content is preserved even if a sequence is malformed.
Related tools