Find and Replace Text

Make many changes to a document at once with find and replace rules that run in order, with a live preview that highlights every replacement.

Runs entirely in your browser. Nothing you add is sent to us.

Create a free account to use the Find and Replace Text

Free forever for this tool. Takes a few seconds — then you come straight back here.

  • All 150 free tools, one login
  • Free website audit with fixes
  • Search Console dashboard
  • Free keyword rank tracker

Already have an account? Sign in

Find and Replace Text — find and replace text

Find and replace text across a whole document in one go, with as many rules as you need. Add find and replace pairs, and they run in order from top to bottom, so you can rename a product, fix a recurring typo and update a phone number in a single pass. Match case and whole words only keep replacements precise, and regular expression mode lets you reorder dates, reformat lists and reuse captured text with $1 and $2. A live preview highlights every change and counts the replacements. Your text is processed in your browser and never uploaded.

How to use the Find and replace

  1. 1 Paste your textPaste the document, list, CSV data or code you want to change into the text box. Up to 300,000 characters can be processed at once.
  2. 2 Add your first ruleType what to find and what to replace it with. Leave the replacement empty to delete every match.
  3. 3 Add more rules if neededPress Add another rule for each extra change. Use the arrows to reorder them, because each rule works on the result of the one above.
  4. 4 Choose matching optionsTurn on Match case, Whole words only or Regular expressions as needed, and watch the preview and counts update as you type.
  5. 5 Copy or download the resultCheck the highlighted preview, then copy the new text, download it as a file, or press Use as input to make another round of changes.

Why use several find and replace rules at once

Most editors let you find and replace one thing at a time. That is fine for a single fix, but real clean-up jobs usually involve several: a rebrand might change the company name, the web address, the email domain and a product name all at once, and a data export might need commas swapped for semicolons, quotation marks removed and dates reformatted.

With this tool you set up all the rules together, see the combined result immediately, and adjust any rule without starting again. Each rule shows its own replacement count, so you can tell at a glance if one of them is matching nothing because of a typo, or matching far more than you expected. Because the original text stays in the left-hand box untouched, you can experiment freely and only copy the result when it looks right.

Rule order matters

Rules are applied one after another, from top to bottom, and each rule works on the text produced by the rules above it. Usually that is exactly what you want, but it means the order can change the result.

Imagine you want to swap two words, turning "cats" into "dogs" and "dogs" into "cats". If the first rule replaces cats with dogs, the second rule will then turn every dog back into a cat, including the ones you just created. The fix is to use a temporary placeholder: replace cats with a unique marker such as ###, then dogs with cats, then ### with dogs. The same thinking applies when one search term is part of another. Put the longer, more specific phrase first, such as "Make It Flow Ltd" before "Make It Flow", so the shorter rule does not break the longer phrase.

Match case and whole words only

By default the search ignores capital letters, so "london" finds London, LONDON and london. Turn on Match case when capitals matter, for example to change the product code "PRO" without touching the word "pro" in normal sentences. Note that the replacement is always inserted exactly as you type it, so a case-insensitive search for "colour" replaced with "color" will turn "Colour" at the start of a sentence into lower-case "color".

Whole words only stops a search matching inside longer words. Without it, replacing "cat" with "dog" would also turn "category" into "dogegory" and "concatenate" into "condogenate". With it switched on, a match must have no letter, digit or underscore immediately before or after it. This works with accented letters too, so searching for "café" as a whole word will not match inside "cafés".

Regular expressions and capture groups

Regular expression mode turns each Find box into a pattern written in JavaScript regex syntax. Patterns can describe things rather than exact text, such as any run of digits, anything inside brackets, or a date in a particular format. A few building blocks cover most everyday jobs.

  • \d matches a digit, \s matches any space, tab or line break, \w matches a letter, digit or underscore, and . matches any single character except a line break.
  • + means one or more, * means zero or more, ? means optional, and {2} means exactly two, so \d{2} matches two digits.
  • Round brackets create a capture group. In the replacement, $1 inserts what the first group matched, $2 the second, and so on. $& inserts the whole match, and $$ inserts a literal dollar sign.
  • Named groups such as (?<year>\d{4}) can be reused in the replacement as $<year>, which keeps complex patterns readable.
  • ^ and $ match the start and end of each line, so ^\s+ removes indentation and \s+$ removes trailing spaces from every line.
  • In the replacement box, \n inserts a new line and \t inserts a tab, so a rule finding ", " and replacing it with \n splits a comma-separated list onto separate lines.

Safety limits for heavy patterns

Some regular expressions can take an extremely long time to run on certain text. Patterns with nested repeats, such as (a+)+ or (\w+\s?)*, can make the regex engine try an exponential number of combinations when a match fails, a problem known as catastrophic backtracking. In many online tools this simply freezes the browser tab.

To prevent that, this tool runs every search in a separate background worker. If a set of rules takes longer than two seconds, the worker is stopped and you see a warning instead of a frozen page. Input is limited to 300,000 characters, a single rule stops after 200,000 matches, and the result cannot grow beyond five million characters. These limits are far above what normal editing needs, but they keep a slip of the keyboard from locking up your device. If you hit the time limit, make the pattern more specific, for example by replacing .* with a narrower class such as [^,]*.

Practical jobs it handles well

Content editors use it to update names, prices, phone numbers and web addresses across long pages before pasting them back into a CMS, to switch American spellings such as "optimize" to British "optimise", and to replace straight quotes with curly ones. Marketers use it to add tracking parameters to a list of links or to tidy exported keyword lists. Developers use it to rename variables in a snippet, convert lists into code arrays, or reformat log files.

Regex mode is particularly good for reformatting data. A rule finding (\d{4})-(\d{2})-(\d{2}) and replacing it with $3/$2/$1 turns ISO dates such as 2026-10-23 into the UK format 23/10/2026. A rule finding ^(.+)$ and replacing it with "$1", (including the quotation marks and the comma) wraps every line in quotes and adds a comma, ready to paste into code. Because everything stays in your browser, it is safe for contracts, customer lists and confidential drafts.

When you are happy with a set of rules, keep a note of them somewhere. The tool does not save anything between visits, so a short list of the patterns you use often will save time the next time the same job comes round.

Examples you can copy

Reformat ISO dates as UK dates (regex mode)

Find:     (\d{4})-(\d{2})-(\d{2})
Replace:  $3/$2/$1

2026-10-23  ->  23/10/2026

Swap two words safely with three rules

Rule 1:  cats  ->  ###
Rule 2:  dogs  ->  cats
Rule 3:  ###   ->  dogs

"cats chase dogs"  ->  "dogs chase cats"

Remove trailing spaces from every line (regex mode)

Find:     [ \t]+$
Replace:  (leave empty)

Common mistakes to avoid

Ignoring the order of rules

Each rule runs on the output of the one above. Put specific phrases before general ones and use a placeholder when swapping words.

Forgetting Whole words only

A short search term can match inside longer words, such as "cat" in "category". Turn on Whole words only for single words.

Using .* where a narrower pattern would do

Greedy patterns match far more than expected and can be slow. Prefer classes such as [^,]* or \d+.

Expecting replacements to copy capital letters

The replacement is inserted exactly as typed. Use Match case and separate rules for capitalised and lower-case versions.

Not checking the counts

A rule showing 0 replacements usually has a typo or the wrong case setting. A huge count may mean it matches too broadly.

Frequently asked questions

Yes. Turn on Regular expressions, put round brackets around the part you want in the Find box, and use $1, $2 and so on in the Replace box.

Searches run in a background worker that is stopped after two seconds, and the input is capped at 300,000 characters, so a runaway pattern shows a warning instead.

Yes. Leave the Replace box empty and every match is removed. The count still shows how many deletions were made.

JavaScript syntax, as used by modern browsers, including lookbehind, named groups and Unicode classes such as \p{L}.

Turn on Regular expressions and type \n in the Replace box. Use \t for a tab.

Yes. Write (?<name>...) in the pattern and $<name> in the replacement.

Up to 20 rules, applied in order from top to bottom. Each shows its own replacement count.

Deleted text has nothing to highlight, and very long results show only the first 100,000 characters in the preview. Copy or download always gives the full text.

No. All processing happens in your browser, so your text never leaves your device.

Free website audit

See how your site scores, free

Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.