Find and Replace

Find and replace text with support for case sensitivity and regex. See replacements in real-time. Free online find and replace tool.

What is Find and Replace?

A find and replace tool searches through text for a specific word, phrase, or pattern and replaces it with different text. Unlike the basic find-and-replace in text editors, this online tool supports regular expressions for advanced pattern matching, case-sensitive or insensitive searching, and whole-word-only matching. It's useful for bulk text editing, data cleanup, code refactoring, and any task where you need to systematically transform text without manually locating each occurrence.

How It Works

Enter your source text, the search term (or regex pattern), and the replacement text. The tool finds all occurrences of the search term and highlights them so you can preview what will change. When you apply the replacement, every match is substituted simultaneously. With regex enabled, you can use capture groups and backreferences for complex transformations — like reformatting dates from MM/DD/YYYY to YYYY-MM-DD. The tool shows a count of replacements made so you can verify the expected number of changes occurred.

Common Use Cases

  • •Bulk-renaming variables or function names across code snippets during refactoring
  • •Cleaning data by replacing inconsistent formatting (e.g., standardizing phone number formats)
  • •Removing unwanted text patterns from copied content like attribution lines or watermarks
  • •Converting date formats across large datasets using regex pattern matching
  • •Replacing placeholder values in templates with actual content for mail merges
  • •Standardizing terminology across documents (e.g., replacing 'user' with 'customer' consistently)

Frequently Asked Questions

Does it support regex?▼

Yes, you can toggle regex mode to use regular expressions in your search pattern.

How do I replace text across multiple lines at once?▼

Enable regular expression mode and use the `s` (dotall) behaviour so that `.` also matches newline characters. Without it, `.` stops at the end of each line and a pattern spanning two lines will never match.

What does the whole-word option actually do?▼

It wraps your search term in word boundaries, equivalent to the regex `\bterm\b`. Searching for "cat" with whole-word enabled matches "cat" but leaves "category" and "concatenate" alone — the usual cause of unwanted replacements.

How do I reuse part of the matched text in the replacement?▼

Wrap the part you want to keep in parentheses to create a capture group, then reference it in the replacement as `$1` (`$2` for the second group, and so on). For example find `(\w+)@(\w+)\.com` and replace with `$1 at $2 dot com`.

Which characters do I need to escape in regex mode?▼

Escape these with a backslash when you want them treated literally: `. ^ $ * + ? ( ) [ ] { } | \`. A bare `.` matches any character, so searching for "3.14" in regex mode also matches "3x14". Turn regex mode off if you only need plain text matching.

Can I preview the changes before applying them?▼

The match count updates as you type, which is the fastest sanity check — if you expected 12 replacements and it reports 400, your pattern is too broad. Compare the before and after with the Text Diff tool when the change is important.

How do I delete text rather than replace it?▼

Leave the replacement field empty. Every match is then removed. This is the usual way to strip a repeated prefix, tracking parameters, or unwanted markup from a list.

Further Reading

Related Tools

More from Text Tools: