Find and Replace

Bulk find & replace text online

Your Text

Result

How Does Find and Replace Work?

Paste your text, enter what you want to find and what to replace it with, then click "Replace All." The tool supports case-sensitive matching, regular expressions for advanced pattern matching, and whole word matching to avoid partial replacements. It shows the total number of replacements made so you know exactly what changed.

Frequently Asked Questions

Does it support regular expressions?
Yes, enable Regex Mode to use full JavaScript regular expression patterns in the Find field.
What does whole word matching do?
Whole word matching only replaces when the search term appears as a complete word, not as part of another word.
Can I do case insensitive replacement?
Yes, uncheck the Case Sensitive option to match text regardless of upper or lower case.

Related Tools

Find and replace, including the regex you actually need

Plain find-and-replace matches literal text; regex find-and-replace matches patterns. The difference matters the moment you need "every phone number", "every date", or "the word cat but not the word catalogue" — and for that last one the answer is the word-boundary token \bcat\b.

Regex tokens that cover most real work

PatternMatchesExample
.Any single character except a newlinec.t matches cat, cot, c9t
\dAny digit\d\d\d\d matches 2026
\wLetter, digit or underscore\w+ matches a whole word
\sAny whitespace\s+ matches a run of spaces or tabs
\bA word boundary\bis\b matches "is" but not "this"
^ / $Start / end of line^\s+ matches leading indentation
* / + / ?Zero or more / one or more / optionalcolou?r matches both spellings
{2,4}Between 2 and 4 repeats\d{4} matches exactly four digits
[abc]Any one of those characters[aeiou] matches any vowel
[^abc]Any character except those[^0-9] matches any non-digit
(…)A capture group, reusable in the replacementsee below
a|bEither alternativecat|dog
.*?Lazy match — as few characters as possibleessential inside HTML tags

Capture groups in the replacement

TaskFindReplace with
Swap "Surname, First" to "First Surname"(\w+), (\w+)$2 $1
Convert 2026-09-10 to 10/09/2026(\d{4})-(\d{2})-(\d{2})$3/$2/$1
Wrap every line in quotes^(.+)$"$1",
Turn a URL into a link(https?://\S+)<a href="$1">$1</a>
Collapse multiple spaces to one\s{2,}a single space
Strip trailing whitespace[ \t]+$nothing

Recipes for tidying pasted text

The traps

  1. Greedy matching. <.*> on a line of HTML swallows everything from the first < to the last >. Use the lazy form <.*?>.
  2. Unescaped special characters. To match a literal dot, plus, question mark, bracket or backslash, escape it: \., \+, \?.
  3. Case sensitivity is usually on by default. Check the flag before concluding a pattern does not match.
  4. Replacement syntax differs by tool. Capture groups are $1 in JavaScript, VS Code and most editors, but \1 in sed, Vim and Python’s re.sub.
  5. Preview before you commit. Always run "find all" first and read the match count. A pattern matching 4,000 times when you expected 40 is telling you something.

Worked example

Reformat 500 lines of "Sharma, Anjali <anjali@example.com>" into "Anjali Sharma | anjali@example.com"

Find: ^(\w+), (\w+) <([^>]+)>$

Group 1 is the surname, group 2 the first name, group 3 the email.

Replace: $2 $1 | $3

One pass, 500 lines, no manual editing — and the pattern documents itself for the next time the export arrives.

More questions people ask

How do I replace only whole words?

Wrap the term in word boundaries: \bcat\b matches the standalone word cat but not catalogue or bobcat. Most editors also offer a "whole word" checkbox that does the same thing without regex.

What is the difference between greedy and lazy matching?

Greedy quantifiers such as .* match as much as possible; lazy ones such as .*? match as little as possible. On HTML, greedy matching swallows multiple tags at once, which is almost never what you want.

How do I reference a captured group in the replacement?

With $1, $2 and so on in JavaScript, VS Code, Sublime and most GUI editors. sed, Vim and Python’s re.sub use \1, \2 instead. Getting this wrong inserts the literal text rather than the capture.

How do I remove all blank lines with find and replace?

Enable regex and multiline mode, find ^\s*$\n and replace with nothing. If the file uses Windows line endings you may need ^\s*\r?\n instead.

Can I use find and replace across many files at once?

Yes — VS Code, Sublime, JetBrains IDEs and command-line sed all support it. Always run the search first and read the match count, and make sure the files are in version control before a multi-file replace.

Everything on this page runs in your browser — nothing you type is uploaded or stored.

Answers, not just a number

Short, exact answers to the questions people ask alongside this tool — the number first, then the working.

For teams, not just visitors

Want this calculator on your own site?

We build the calculators on SnoopTool as embeddable widgets in your branding, wired to your own lead form — the same maths, your colours, your domain, your leads. Tell us which one and we will send back a working demo you can put in front of your team.

One reply from a person, within one business day. No newsletter, no sequence. See our privacy policy.

Copied to clipboard!