About this tool
The Source-Code String Escaper / Unescaper turns arbitrary text into a safe string literal for the programming language you pick, or reverses a literal back into plain text. It is the quickly-needed helper for pasting a multi-line block, a path, or text containing quotes into source code without breaking it. Everything runs in your browser as a pure string transform; nothing is uploaded.
Each language uses its own escape table. JavaScript and JSON escape backslash, double-quote, and the control set (\n \r \t \b \f) and emit \uXXXX for other control or non-ASCII characters. Java uses the same C-style set with \uXXXX over UTF-16 code units. C, C++ and C# add \0 \a \v and \xHH for bytes. SQL doubles single quotes ('' ), the ANSI-standard way to embed a quote in a string literal. XML/HTML replaces & < > " ' with & < > " ' and emits &#nnn; for other non-printable characters.
Unescape reverses the same tables: it parses \n, \t, \xHH, \uXXXX and \u{...} sequences for the C-family languages, collapses doubled quotes for SQL, and resolves named and numeric (&#nnn; / &#xHH;) entities for XML/HTML. Choose the target language and whether to escape or unescape. This tool is broader than the JSON-only and HTML-only escapers — it covers all seven targets in one place.