Free online tools

CSS Identifier Escaper

Turn an ID or class name such as 2-column or foo.bar into a selector fragment that matches the literal text.

Enter your values

This tool processes your input in your browser.

Result

Escape punctuation with its CSS meaning in mind

A dot in an unescaped selector begins a class component. When it is part of the actual identifier, the backslash keeps it literal.

Escape a leading digit numerically

A leading digit uses a hexadecimal escape followed by a space. The space terminates the numeric escape and belongs to the CSS syntax rather than the identifier.

Frequently asked questions

Can I put a complete CSS selector into this tool?

Use one literal identifier at a time. A complete selector contains meaningful combinators and punctuation that should be interpreted before escaping any individual name.