Escape Sequence Visualizer
Escape or decode string literals for JavaScript, JSON, Python, Java, C# and Go, and see every character, escape sequence and hidden code point.
Output options
Character breakdown
| # | Char | Escape | Code point | UTF-8 | Description |
|---|
Escape sequence cheat sheet
\0- U+0000 null. In JavaScript, Python, Java and C this is really an octal escape, so
\01is not null followed by "1". \a- U+0007 bell. Exists in C, Python, Go and C#, but not in JavaScript, JSON or Java.
\b \f \n \r \t- backspace, form feed, line feed, carriage return, tab. The only lettered escapes JSON allows.
\v- U+000B line tabulation. Valid in JavaScript, Python, C, C# and Go; not valid in JSON or Java.
\xNN- Two hex digits in JavaScript, Python and Go. In C it is greedy and in C# it takes 1โ4 digits, which makes both ambiguous. JSON and Java have no
\xat all. \uXXXX- One UTF-16 code unit. Astral characters need a surrogate pair in JSON and Java.
\u{XXXXX}- JavaScript only (ES2015+). One full code point.
\UXXXXXXXX- Eight hex digits, one full code point. Python, C, C# and Go.
\NNN- Octal. 1โ3 digits in Python, Java and C; exactly 3 in Go; not allowed in JSON or C#.
How it works
Paste text on the left and the escape sequence visualizer rewrites it as a source-code
string literal on the right, then breaks it down character by character: the code point,
what the character actually is, the escape sequence your language needs, and the raw UTF-8
bytes. Flip the direction and it goes the other way, decoding \n,
\t, \x41, \u00E9, \u{1F600},
\U0001F600 and octal escapes back into real characters so you can see what a
literal really contains.
The rules follow each language's own specification rather than one generic escaper:
ECMA-262 ยง12.9.4 for JavaScript, RFC 8259 ยง7 for JSON, the Python Language Reference ยง2.4.1,
JLS ยง3.10.7 for Java, ISO C ยง6.4.4.4 for C and C++, and the Go language specification's
rune literals. That matters because the flavours genuinely differ: JSON has no
\x and no \v, Java has no \x and turns
\uXXXX into a real character before the compiler sees the string, C's
\x keeps eating hex digits, and an unknown escape such as \q is a
hard error in JSON but silently yields q in JavaScript. The tool tells you which
is which instead of guessing.
Invisible characters are the reason most people end up here, so they are named explicitly: zero-width spaces, joiners, bidirectional overrides, non-breaking spaces, soft hyphens and the byte-order mark all get a row of their own with a highlighted warning. Everything runs 100% in your browser with no upload, so pasting a suspicious log line, a broken CSV cell or a production config snippet is safe.
Frequently asked questions
What is an escape sequence visualizer?
It turns text into a source-code string literal and back again, then breaks the result down character by character. For every code point you see the U+ number, what the character actually is, the escape sequence your language needs and the raw UTF-8 bytes, so a stray tab, a smart quote or a zero-width space stops being invisible.
Why does the same text escape differently in JSON and JavaScript?
Because the specifications differ, and this tool follows each one instead of using a single generic escaper. RFC 8259 allows only \" \\ \/ \b \f \n \r \t and \uXXXX, so JSON has no \x, no \v and no \0, and an emoji must be written as a surrogate pair. ECMA-262 adds \x, \v and \u{...}, Java has no \x at all, C's \x keeps eating hex digits, and Go needs exactly three octal digits. The page names the spec it applied for the language you pick.
How do I find an invisible character that is breaking my file?
Paste the broken line into the input box. Every control and invisible code point gets its own highlighted row with its real Unicode name, so zero-width spaces, joiners, bidirectional overrides, non-breaking spaces, soft hyphens and byte-order marks are all called out by name. Everything runs in your browser with no upload, so it is safe to paste a log line or a production config snippet.