About the Find and Replace Text tool
Changing a product name, correcting a misspelled word or updating a date throughout a long document is slow and risky by hand. This find and replace tool changes every occurrence at once and tells you how many replacements were made. Whole-word matching stops cat from changing inside category, case matching keeps names exact, and regular expressions handle patterns such as every phone number or date. It works on pasted text of any length without uploading it. For comparing the before and after versions, use the Text Diff Checker, and to test a pattern first, try the Regex Tester.
Four switches decide how matching behaves. With case sensitivity on, Cat and cat count as different words. Whole-word mode stops cat from matching inside concatenate or scatter. Pattern mode lets you describe what to find rather than spell it out, for example every sequence of numbers or every email address in the text. Replace-first mode stops after the opening match when only one change is wanted.
Patterns become really powerful with capture groups. Put brackets around part of the pattern and reuse that part in the replacement as $1, $2 and so on, which lets you rearrange the pieces of a line. Swapping the order of day and month in every date of a long spreadsheet export, for instance, becomes one pattern instead of hundreds of manual edits.
A message explains what went wrong when a pattern is invalid, and the input box always keeps your original text, so you can refine the search and run it again from the same starting point.
How to use the Find and Replace Text tool
- Paste the textAdd the document, list or code you want to edit.
- Fill in find and replaceLeave the replacement empty to delete every match instead.
- Choose matching optionsTurn on case sensitivity, whole words or regular expressions as needed.
- Run it and copyThe edited text appears below with a count of the changes made.
Find and Replace Text features
- Every occurrence changed in a single pass
- Matching with or without regard to capitals
- Whole-word mode that leaves longer words alone
- Regular expressions with capture groups in the replacement
- Option to change only the first match
- Count of replacements made
- Plain explanation when a pattern is invalid
- Copy and download buttons for the result
Common uses
- Renaming a product, person or brand across a document
- Removing the same opening text from every line of a list
- Reformatting dates, phone numbers or codes with a pattern
- Swapping straight quotes or stray symbols in bulk
- Updating an address that changed across a page of links
Find and replace: whole words, case matching and regular expressions
Find and replace saves hours when the same change has to be made many times: updating a product name, fixing a repeated typo, changing a date format or reformatting a list. Used carelessly, though, it can change things you did not mean to change. This guide explains whole-word and case options, introduces regular expressions for pattern-based changes, and shows how to replace safely.
The basic options
- Match case: "Apple" matches only "Apple", not "apple" or "APPLE". Use it when capitalisation carries meaning, such as names and brands.
- Whole word: "cat" matches "cat" but not "category" or "concatenate". Use it whenever the search term could appear inside longer words.
- Replace all versus one at a time: replacing all is fast; stepping through matches lets you skip the ones that should not change.
A classic mistake
Replacing "man" with "person" across a document without whole-word matching turns "manager" into "personager" and "human" into "huperson". Always ask whether your search term could appear inside other words, and if so, turn on whole-word matching.
Regular expressions
Regular expressions, or regex, describe patterns instead of fixed text. A few building blocks cover many everyday jobs:
| Pattern | Matches |
|---|---|
\d | any digit |
\d+ | one or more digits |
\s+ | one or more spaces, tabs or line breaks |
^ and $ | start and end of a line |
[aeiou] | any one of the listed characters |
(text) | a group you can reuse in the replacement |
Groups are powerful: in many tools, $1 in the replacement inserts whatever the first group matched. Regex Tester lets you experiment with patterns and see matches highlighted before using them.
Useful regex replacements
- Collapse spaces: find
\s{2,}, replace with a single space. - Remove trailing spaces: find
\s+$with multi-line matching, replace with nothing. - Reformat dates: find
(\d{2})/(\d{2})/(\d{4})and replace with$3-$2-$1to turn 25/12/2026 into 2026-12-25. - Wrap lines in quotes: find
^(.*)$, replace with"$1".
A worked example: renaming a product across a manual
A company renames its product from "SmartBox" to "HomeHub". A plain replace would also change "SmartBoxes" into "HomeHubes" and miss "Smartbox" typed with a lowercase b. Instead, search case-insensitively with whole-word matching for "SmartBox", review the matches, and replace with "HomeHub". Then search for "SmartBoxes" separately and replace with "HomeHubs". Finally, search the document once more for "smartbox" to confirm nothing remains.
Previewing before replacing
Before replacing all, look at how many matches were found. If you expected 10 and see 87, the search term is catching more than you intended. Narrow it with whole-word matching, case matching or a more specific phrase.
Keeping a copy
Replacements across a whole document are easy to make and hard to undo after saving. Keep a copy of the original, or compare before and after with Text Diff Checker to see every change at a glance.
Find and replace for lists and data
Find and replace works well for reformatting lists: replacing commas with line breaks to turn a comma-separated list into lines, or the reverse with Comma Separator. For adding text to the start or end of every line, Add Prefix and Suffix to Lines is quicker than writing a pattern.
Common mistakes
- Forgetting whole-word matching and corrupting longer words.
- Ignoring capitalised versions at the start of sentences.
- Using regex special characters such as
.or?in a plain search where they behave unexpectedly. - Replacing all without checking the number of matches first.
Replacing in code and configuration
Developers use find and replace to rename variables, update URLs or change settings across files. In code, whole-word matching and case matching are essential, because a short name like id appears inside many longer words. After replacing, run the program or tests to make sure nothing broke. For structured data such as JSON, a dedicated formatter like JSON Formatter helps you check that the result is still valid.
Replacing line breaks and tabs
Many find-and-replace tools let you search for line breaks and tabs using \n and \t in regex mode. That makes it easy to turn a list into a single line separated by commas, or to replace tabs with commas when converting spreadsheet data. Test on a small sample first, because a pattern that matches line breaks can join an entire document into one line in a single click.
Building a reusable replacement list
If you repeatedly make the same changes, for example updating old product names or fixing common misspellings, keep a list of find-and-replace pairs. Applying the list in a set order each time makes the process quick and consistent, and the list itself documents your editorial rules.
Replacing with nothing
Leaving the replacement empty deletes every match, which is a quick way to remove repeated labels, tracking codes in URLs or unwanted characters. Combined with a regex such as \[\d+\], it removes citation numbers like [12] from copied text in one step, which is handy when quoting from encyclopedia-style pages.
Privacy
Find and replace runs in your browser. Your documents and data are never uploaded.
Frequently asked questions
How can I remove a word everywhere it appears?
Enter the word in the find box and leave the replacement box blank. Every match is deleted, and the counter tells you exactly how many instances were removed from the text.
Why use whole-word matching?
It insists on a word boundary on both sides of each match. Searching for cat then changes the word cat itself but leaves longer words such as concatenate and scatter alone; without it, any matching run of letters is replaced.
How do I use capture groups in a replacement?
Wrap a section of the pattern in brackets, then write $1 in the replacement wherever the first bracketed section should appear, $2 for the second, and continue in the same way. Matching ([0-9]{2})-([0-9]{2}) and replacing it with $2/$1, for example, swaps the two numbers.
Why is my regular expression rejected?
Most often a bracket was opened and never closed, or a symbol with a special meaning was used as ordinary text. Dots, plus signs, question marks and brackets all act as instructions in a pattern, so put a backslash before any of them that you want matched literally.
How much text can it handle?
There is no fixed limit. Replacements happen inside your browser, so the only constraint on a very large document is the memory of your own computer, not an upload size or server quota.
Is my original text overwritten?
No. Whatever you pasted remains in the input box, which means you can tweak the search terms or switch options and rerun the replacement from the untouched original as often as needed.