Skip to main content

CSS Entity Encoder — Encode Text to CSS Hex Escapes Online

Free CSS entity encoder: turn any text into CSS hexadecimal escapes like \48\65\6C\6C\6F ("Hello"). Choose Full mode to encode every character, or Safe-only to keep letters and digits readable. Spec-correct terminator spaces, surrogate-pair handling for emoji, decode-back verification, live examples, copy & download. 100% client-side, no signup, no uploads.

Not what you need? This tool fully encodes every character into \HEX form for obfuscation. For minimal, selector-safe escaping that follows the JavaScript CSS.escape() rules (leaves "Hello" as "Hello"), use our CSS Escape tool. To turn CSS escapes back into plain text, use CSS Unescape. For HTML entities (A) instead of CSS escapes, use the HTML Entity Encoder.

Input text

CSS escapes output

Decode back (verification)

Live character map

Every cell below is computed live by the page engine — including the tricky terminator-space cases.

CharCode pointFullSafe-only

When to use CSS entity encoding

Obfuscate text in CSSHide strings inside content: "..." rules so they are not trivially readable in the stylesheet source. Full mode turns Hello into \48\65\6C\6C\6F.
Test parsers & filtersGenerate edge-case fixtures: terminator spaces (\41 B vs \41B), 6-digit escapes (\000041), surrogate pairs (\D83D\DE00), and NULL handling.
Learn escape tokenizationSee exactly how CSS consumes hex escapes — where the terminator space is required and where it is optional — with the live character map above.
Honest note on "bypass" use: encoding is obfuscation, not security. Anyone can decode \48\65\6C\6C\6F back to "Hello" in seconds, so never rely on it to protect secrets, and only test filters on systems you own or have explicit permission to test.

Frequently asked questions

What does this CSS entity encoder do?
It converts every character of your text into a CSS hexadecimal escape — a backslash followed by the character's hex code. For example, "Hello" becomes "\48\65\6C\6C\6F" in Full mode. The output is valid anywhere CSS escapes are accepted, such as inside a content: "..." string. Everything runs in your browser; nothing is uploaded.
What is the difference between Full and Safe-only mode?
Full mode encodes every character, including plain letters — maximum obfuscation: "Hi!" becomes "\48\69\21". Safe-only mode keeps letters and digits readable and escapes only everything else, so "Hi!" becomes "Hi\21". Choose Full when you want the text fully hidden, Safe-only when you want the output to stay partly human-readable.
Why does the output sometimes contain a space, like "\41 B"?
That space is a required terminator, not a typo. A CSS hex escape keeps consuming hex digits, so "\41B" would be read as a single character — U+041B, the Cyrillic capital letter I — instead of "A" followed by "B". Whenever an escape is followed by a hex digit (0-9, A-F), this tool inserts a space that the CSS parser consumes as the end of the escape. "\41 B" therefore decodes to exactly "AB".
How are emoji and astral-plane characters encoded?
JavaScript stores characters above U+FFFF as UTF-16 surrogate pairs, and this tool encodes each code unit separately. The emoji U+1F600 becomes "\D83D\DE00" — two escapes that CSS reassembles into the original character. Decoding "\D83D\DE00" returns the emoji exactly, which the round-trip check on this page proves.
How can I verify the encoding is correct?
Paste the encoded output into the "Decode back" box, or press "Verify round-trip": the tool decodes the CSS escapes and compares the result with your original text character by character. If they match, the encoding is provably lossless. Try it yourself — "\48\65\6c\6c\6f" decodes to "Hello".
When would I use CSS entity encoding?
Typical uses: hiding text inside CSS content strings so it is not trivially readable in the stylesheet, generating fixtures to test CSS parsers, and studying how browsers tokenize escapes. An honest warning: encoding is obfuscation, not security — anyone can decode "\48\65\6C\6C\6F" in seconds, so never rely on it to protect secrets, and only probe filters on systems you own or have explicit permission to test.
How is this different from the CSS Escape tool?
The CSS Escape tool implements the JavaScript CSS.escape() rules: it escapes only characters that genuinely need escaping in selectors and identifiers, keeping output readable — "Hello" stays "Hello". This encoder does the opposite: it converts every character into \HEX form ("\48\65\6C\6C\6F") for full obfuscation. To turn CSS escapes back into plain text, use the CSS Unescape tool.
Is my text sent to a server?
No. The encoder and decoder are plain JavaScript running entirely in your browser — your text never leaves your device. Once the page has loaded you can go offline and keep encoding.

Also searched as: css hex entity encoder, encode text to css escapes, convert text to css hex escapes, text to css escape online, css escape every character, encode all characters css escape, css unicode escape encoder, css content string encoder, css obfuscate text, string to css escape sequences, css entity decode online, css hex escape decoder, css escape terminator space, css surrogate pair escape.

Related tools: CSS Escape (CSS.escape) · CSS Unescape · HTML Entity Encoder · Unicode Lookup

Free tool by NRTechStudio