Regex Special Character Escaper
Escape special regex characters in a string so it can be used as a literal pattern. Free, instant.
How to use this tool
- Enter text to escape in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your escaped regex and the full breakdown beneath it.
Escape a plain text string so all special regex metacharacters are treated as literals when passed to RegExp().
Frequently asked questions
- Which characters need escaping in regex?
- The characters . * + ? ^ $ { } ( ) | [ ] and \ have special meaning in regex and must be escaped with a backslash to match literally.