Turn plain text into valid Java string literal content and back. Fix quotes, backslashes, and control characters so you can paste safely into source code or config.
| Char | Escape | Unicode | Description |
|---|---|---|---|
| " | \" | \u0022 | Double quote |
| ' | \' | \u0027 | Single quote |
| \ | \\ | \u005C | Backslash |
| newline | \n | \u000A | Line feed |
| tab | \t | \u0009 | Horizontal tab |
| carriage return | \r | \u000D | Carriage return |
| backspace | \b | \u0008 | Backspace |
| form feed | \f | \u000C | Form feed |
Java string escaping adds backslashes before special characters in string literals so the compiler reads them correctly. Without it, a single quote or backslash in your text can break the literal or change the meaning of the next character.
Use escaping when you need to embed quotes, backslashes, newlines, or tabs inside a Java string, when building file paths or regex patterns in code, or when generating Java source. Use unescaping to turn stored or logged escape sequences back into readable text.
\uXXXX sequences.Common questions about escaping and unescaping Java strings.
Escape backslashes first, then quotes and control characters. Our tool applies that order so you do not double-escape backslashes.
Yes. Unescape converts \uXXXX to the corresponding character. Escape does not convert characters to \u by default; it only escapes the standard set (quotes, backslash, n, t, r, b, f).
Use Escape when you have plain text (e.g. from a form or file) that you want to paste into a Java string literal. Use Unescape when you have a string that already contains escape sequences and you want to see the real characters.
Yes. Input and output are processed in your browser. Nothing is sent to a server, so your data stays private.