Kalcify
Tools
BlogAboutContact
Kalcify

The World's Smartest Free Online Tools. 30+ free calculators & tools — no signup required.

💰 Finance

  • Loan EMI Calculator
  • Global Wealth Calculator
  • Investment Calculator
  • Salary Calculator
  • Sales Tax Calculator
  • Deposit Calculator
  • Compound Interest Calculator
  • Margin & Markup Calculator
  • ROI Calculator

📚 Education

  • Grade Calculator
  • Percentage Calculator
  • Countdown Timer
  • Online Graph Generator

Quick Links

  • Blog
  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service
  • Disclaimer

© 2026 Kalcify. All rights reserved.

Made with ❤️ for the Web 🌍

  1. Home
  2. Tools
  3. Regex Escape

Regex Escape / Unescape

Escape special characters so a string matches literally in a regular expression, or unescape a pattern back to plain text. Prevents regex injection bugs. 100% client-side.

100% Free No Signup Instant Results

Literal Text

Escaped Pattern

https:\/\/example\.com\/path\?id=42&q=a\+b \(v1\.0\)
Verified: this pattern matches your input exactly.

Escape Strings for Safe Regex Use

Building a regular expression from a variable or user input is a classic source of bugs. Characters like the dot, question mark, and parentheses all mean something special to a regex engine, so a search term like "file (1).txt" will not match what you expect — and can even throw an error or create a security hole known as regex injection. Escaping fixes this by backslash-prefixing every special character, producing a pattern that matches your text literally and safely. This tool escapes and unescapes strings instantly as you type. It even verifies the result: when you escape a string, it confirms the generated pattern actually matches your original input, so you can trust the output. Everything runs in your browser with no data leaving your device.

Escape and Unescape in One Place

The tool works in both directions. Escape mode turns a literal string into a regex-safe pattern — ideal when you are constructing a dynamic RegExp in JavaScript, Python, or any language, or feeding a search term into a find-and-replace. Unescape mode does the reverse, stripping the backslashes so you can read the plain text that an escaped pattern represents. A one-click swap lets you flip between the two, and the verification badge gives you confidence that an escaped pattern is correct. Whether you are hardening a search feature, debugging a pattern, or just learning how regex escaping works, this is the fastest way to get it right.

How to use this Regex Escape / Unescape?

1

Pick a Mode

Choose Escape to make a string regex-safe, or Unescape to reverse it.

2

Enter Text

Type or paste your literal string or escaped pattern.

3

Verify

In escape mode, a badge confirms the pattern matches your input exactly.

4

Copy

Copy the escaped or unescaped result in one click.

Frequently Asked Questions

Regex escaping takes a plain string and adds backslashes before every character that has a special meaning in regular expressions — like . * + ? ( ) [ ] and others. The result is a pattern that matches your original text exactly, instead of the special characters being interpreted as regex operators.
Any time you build a regex from user input or a variable. For example, if a user searches for "a.b", you do not want the dot to match any character — you want a literal dot. Escaping the input first prevents both incorrect matches and "regex injection" bugs. It is essential for search features, find-and-replace, and dynamic pattern building.
The regex metacharacters: . * + ? ^ $ { } ( ) | [ ] \ / and the hyphen -. Each is prefixed with a backslash so the regex engine treats it as a literal character rather than an operator.
Unescape reverses the process: it removes the backslash before each escaped character, turning an escaped pattern back into the plain literal text. This is handy for reading what an escaped pattern actually matches.
No. Escaping and unescaping happen entirely in your browser with simple string operations. Your text never leaves your device.

Related Tools

Regex Tester & Matcher

Real-time regex editor & visual tester

Use Free

String Escape & Unescape

JSON, Base64 & URL string encoding

Use Free

JSON Formatter & Validator

Format and validate JSON

Use Free