CSS Unescape — Decode CSS Escape Sequences Online
Free CSS unescape tool: turn escaped CSS back into normal text. Decode hex escapes like \31 and \26, character escapes like \: and \-, and special cases like \a (newline) — following the exact rules of the CSS Syntax Level 3 specification. With an escape highlighter, batch mode, live round-trip proof, copy & download. 100% client-side, no signup, no uploads.
| # | Escape found | Type | Decodes to | Code point |
|---|
| Line | Input | Decoded | Escapes |
|---|
Live proof
Every keystroke is verified twice: a round-trip check re-escapes the decoded text with the browser's native CSS.escape() and decodes it again, and a selector test runs your escaped input through a real querySelector call.
How CSS unescaping works
CSS lets any character be written as an escape sequence starting with a backslash. Unescaping reverses that, using the consume an escaped code point algorithm from CSS Syntax Level 3:
- Hex escape: a backslash followed by 1–6 hex digits.
\0041→A,\31→1. One whitespace after the digits is the terminator and is consumed, so\31 2345decodes to12345— the space disappears. - Character escape: a backslash followed by any non-hex, non-newline character yields that character literally.
\:→:,\-→-,\\→\. - Special cases:
\0and out-of-range escapes become the replacement character�(U+FFFD); a backslash at the end of input does the same; a backslash directly before a line break is a parse error and both are dropped.
Common escapes cheat sheet
Leading digits
\31 23abc → 123abc\32 xl → 2xl
Punctuation
\: → : \. → .\# → # \- → -
Whitespace
\a → newline\9 → tab \20 → space
Unicode
\e9 → é\1F600 → 😀
Gotcha: \t
\t → t (letter!)
Real tab is \9
Invalid
\0 → � (U+FFFD)\D800 → � (surrogate)
Going the other direction? Use our CSS Escape tool to turn normal text into valid CSS escapes.
Frequently asked questions
What does this CSS unescape tool do?
It converts CSS escape sequences back into normal characters. Paste escaped text — for example \31 2345 — and the tool decodes it to 12345, following the CSS Syntax Level 3 rules: hexadecimal escapes (\0041 becomes A), simple character escapes (\: becomes :), and special cases like \a becoming a line break. Everything runs in your browser; nothing is uploaded.
How do I decode a CSS escape like \31 back to a normal character?
Paste it into the input box and the decoded text appears instantly. \31 2345 decodes to 12345 (hex 31 is the digit "1", and the space after it is just the escape terminator, so it is consumed), \32 xlctext-base decodes to 2xlctext-base, and my-id\:guid decodes to my-id:guid. The escape highlighter below the output shows every escape found, the character it decoded to, and its Unicode code point.
What is the difference between hex escapes and character escapes in CSS?
A hex escape is a backslash followed by 1 to 6 hexadecimal digits — for example \0041 or \e9 , which decode to A and é. If a space, tab, or newline follows the digits, it is consumed as the terminator and disappears. A character escape is a backslash followed by any non-hex, non-newline character, and it simply yields that character: \: becomes :, \- becomes -, and \. becomes a dot. You can see both kinds labeled in the highlighter table.
Why does \t not decode to a tab?
Because in CSS, \t is a character escape, not a tab — the letter t is not a hexadecimal digit, so the backslash is dropped and you get the literal letter t. A real tab is written as the hex escape \9 (hex 9 is the tab character), optionally followed by a space terminator: \9 decodes to a tab. The same trap applies to \n, which decodes to the letter n, not a newline — a newline is \a .
What happens with \0 or other invalid CSS escapes?
Per the CSS specification, a \0 escape (NUL) decodes to the Unicode replacement character � (U+FFFD), as do escapes for surrogate code points like \D800 and values above U+10FFFF such as \110000. A backslash at the very end of the input also becomes �. A backslash directly followed by a line break is a parse error and both characters are silently dropped. The tool implements all of these rules exactly.
Can I unescape many selectors or strings at once?
Yes — enable batch mode and paste one escaped value per line. The tool decodes every line independently and shows a results table with the input, the decoded output, and how many escapes each line contained, so you can scan dozens of values in one pass. The copy button still grabs the full decoded output and download saves it as a text file.
How can I trust that the decoded result is correct?
Two live proofs run on every keystroke. First, a round-trip check: the tool re-escapes the decoded text with the browser's native CSS.escape() function and decodes it again — if the result matches, the decoding is verified. Second, a live selector test: when your input is a valid escaped selector, the tool uses it in a real querySelector call against a hidden element carrying the decoded ID and reports whether it matches.
Should I use this tool or the CSS Escape tool?
They are opposites. Use CSS Escape (nrtechstudio.com/tools/css-escape/) when you have normal text and need valid CSS escapes — for example turning my-id:guid into my-id\:guid. Use this CSS Unescape tool when you already have escaped CSS — for example \31 23abc from a stylesheet or generated code — and want the readable text 123abc back.
CSS Unescape · spec-accurate decoding per CSS Syntax Level 3 · 100% client-side — your text never leaves this page.
Free tool by NRTechStudio