CSS Character Escape
Online CSS character escape tool with identifier/string modes for escaping and unescaping selectors, supporting Chinese and special symbols, ideal for frontend styling, selector debugging, and automation scripts.
Escape mode
CSS Character Escape Guide
This tool helps safely escape and unescape CSS selectors and string values. It is useful for frontend styling, selector generation in automation scripts, scraping utilities, and debugging complex styles.
CSS escape rules
Identifier rules
- Special symbols are prefixed with backslash
- Non-ASCII characters are escaped as Unicode code points
- Leading-digit identifiers follow CSS numeric escape rules
- Spaces can be escaped as \
String rules
- Backslash is escaped as \\
- Double quote is escaped as \"
- Single quote is escaped as \'
- Line breaks, CR, and TAB are escaped as \n / \r / \t
Use cases
- Handle #, ., [, ] and other symbols in selectors
- Handle Chinese or multilingual class names
- Handle selectors starting with digits such as .123class
- Handle quoted CSS string values with line breaks
Tips
- Use Identifier mode for selectors.
- Use String mode for property values.
- You can paste Unicode-escaped selectors for unescaping.