Regex escape
Escape the characters with special meaning in a regular expression, so text matches literally.
Regex escape
A regular expression treats characters like . * + ? ^ $ { } ( ) | [ ] and \ as instructions, not literal text. Paste in a filename, a price, a URL or any string that happens to contain one of them, and this tool escapes every special character with a backslash so the result matches that exact text — nothing more, nothing less. Switch direction to unescape and it reverses the process: strip the backslashes back off a pattern to recover the plain string it came from.
The dialect option decides which characters actually need escaping. JavaScript and PCRE share the same core metacharacter set, so a pattern built for one behaves the same in the other. POSIX Basic Regular Expressions — the default for plain grep and sed — are narrower: + ? { } ( ) and | are ordinary literal characters there, not metacharacters, so escaping them is skipped rather than applied blindly. Turn on "escape delimiter" when the pattern will be written between slashes, like /pattern/, so a literal / doesn't end the pattern early.
Two options handle multi-line input. "Each line as its own pattern" wraps every line in ^ and $, turning a list of exact strings into whole-line-matching patterns — handy for building an allowlist or blocklist entry by entry. "Join lines into one alternation" goes further, combining every line into a single (?:a|b|c) group ready to drop straight into one regex. Unescaping reverses both: it splits an alternation back into lines and strips the anchors off, so recovering the source list from a built pattern is one click.
Everything runs locally in your browser. The text and patterns you paste — including filenames, tokens or paths you'd rather not upload — are never sent anywhere; escaping happens entirely on your device.