Back to Tools
CSS Escape Tool
CSS Escape Tool
Escape special characters in CSS selectors and property values for safe usage
CSS PRO
Escaped Result
About the CSS Escape Tool
Escape special characters so they are safe to use in CSS selectors.
How to use the CSS Escape Tool
- Paste your code into the input box, or click Sample to load an example.
- Choose the Escape Mode: CSS Selector (for JS querySelector) or CSS Identifier (for Stylesheet).
- Press Escape CSS String.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Worked example
.my-class#123 needs the characters escaped so that it is a valid selector.
Tips
- Identifiers cannot start with a digit unless the digit is escaped.
Frequently Asked Questions
Characters such as #, ., : and digits at the start have special meanings in selectors.