Java Escape Unescape

Escape raw text into Java-safe string literal content or decode Java escape sequences back into readable text with strict, deterministic rules.

Last updated: August 2026 | By Workshelve Team

Rule
escape \, ", control chars, and optionally non-ASCII with \uXXXX
Output
Output will appear here...

Escape sequences

0

Control chars

0

Output chars

0

Standard Java escapes

The tool handles backslash, quotes, tab, newline, carriage return, form feed, and backspace using ordinary Java string rules.

Strict unicode decoding

Unicode escapes are decoded from \uXXXX sequences, including repeated-u forms such as \uu0041.

No runtime evaluation

Everything is transformed with explicit parsing logic, so the output does not depend on eval, Function, or browser quirks.

How Java String Escaping Works

Java string literals use backslash-based escapes so characters like line breaks, tabs, quotes, and literal backslashes can be represented safely inside source code. A newline character becomes \n, a tab becomes \t, and a literal double quote becomes\".

This tool follows deterministic rules instead of guessing. Escape mode always rewrites the same input the same way, and unescape mode only accepts escape sequences that are valid under the parser implemented here.

If you enable ASCII-only escaping, any non-ASCII code point is emitted with Java unicode escapes so the output is friendlier for older source files or systems that prefer plain ASCII text.

Worked Examples

Escape Example

Input: Hello "Java"
Output: Hello \\"Java\\"

Unicode Example

Input: A\\u00A9
Unescaped:

Java Escape Reference

Sequence
Meaning
\\
Backslash
\"
Double quote
\'
Single quote
\n
Newline
\t
Tab
\r
Carriage return
\f
Form feed
\b
Backspace
\u0041
Unicode A

Related Tools