What this tool does
It escapes text for a regular C# string literal — the "..." form, not the verbatim @"..." form:
- backslashes are doubled;
"is escaped;'is left alone, since it delimits achar, not astring;\a(bell),\v(vertical tab) and\0(NUL) are emitted as named sequences — these three are what distinguish the C# escape set from the JavaScript one;- newline, carriage return, tab, backspace and form feed get their usual named forms;
- remaining control characters become
\uXXXX.
Non-ASCII characters are left as they are: C# sources are UTF-8, and an escaped accent would only hurt readability.
When you need it
Hard-coding a connection fragment, a regex, a file path or a log template into a .cs file. Paths are the common case: \\server\share has to be doubled in a regular literal, and getting it wrong produces a tab or a form feed instead of a directory separator.
What it does not do
It does not choose the literal form for you. If your text is mostly backslashes — a Windows path, a regex — a verbatim @"..." literal is usually more readable than the escaped form this tool produces, and it follows a different rule.
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.