Text & Writing
Find and Replace Text
Find and replace words or phrases across any text, with case-sensitive, whole-word and regular-expression options.
How to use
- 1Paste your text and enter what to find and what to replace it with.
- 2Adjust the options; the result and number of replacements update live.
Frequently asked questions
Can I use regular expressions?
Yes. Turn on 'Regular expression' to use JavaScript regex syntax, including capture groups like $1 in the replacement.
What does 'Whole words only' do?
It only matches complete words, so replacing 'cat' won't change 'category' or 'concatenate'.
How do I delete every occurrence of a word?
Enter the word in Find and leave Replace empty — every match is removed.
A worked example of why 'whole words only' matters
Replacing "cat" with "dog" in "The cat sat. Cat category." without whole-word matching produces "The dog sat. dog dogegory." — notice "category" gets mangled into "dogegory" because the plain substring "cat" inside "category" matches too, and the replacement doesn't respect word boundaries at all. Turn on "Whole words only" with the same input and it becomes "The dog sat. Cat category." (with case-sensitive also on, so capital "Cat" at the sentence start no longer matches lowercase "cat") — only the standalone word "cat" gets replaced, leaving "category" completely untouched.
Why $1, $2 only work with the regex toggle on
Replacing (\d+)-(\d+)-(\d+) with $3/$2/$1 against "2024-01-31" produces "31/01/2024" — the parentheses capture each number group, and $1, $2, $3 in the replacement reference them back in a different order, which is exactly how you'd reformat a date from ISO (YYYY-MM-DD) to a day/month/year display format in one step. This capture-group substitution syntax is specific to actual regex replacement — with the Regular expression toggle off, a literal $ in your replace text is treated as a plain character, which is also why a price like "price $5" replacing "$5" with "$6" correctly produces "price $6" rather than JavaScript's special regex replacement patterns (where $$ or $& have specific meanings) accidentally kicking in.
Why this runs the same regex engine your code does
With Regular expression turned on, the Find field is compiled as-is into a real JavaScript RegExp with the u (Unicode) flag always applied — meaning any pattern that works here will behave identically in your own JavaScript code, and vice versa. That also means the usual regex footguns apply: an invalid pattern like a stray unmatched ( throws an explicit "Invalid regular expression" error rather than silently doing nothing, and characters with special regex meaning (., *, +, ?, $, etc.) need escaping in Find when regex mode is off, which the tool does for you automatically — but not when you've explicitly asked for raw regex syntax.
An empty Find box changes nothing, and underscores join the word
If I leave Find blank, the text comes back untouched and the Replacements counter stays at 0, even when Replace with has something in it. Whole words only treats letters, digits, and underscores as part of a word, so replacing cat does not touch cat_dog or cat2, not only category. Case sensitive starts off, which is why Cat and cat both change unless I turn that switch on. A bad pattern with Regular expression on stops and shows Invalid regular expression plus the reason, instead of a partial result. With that switch off, a dot or a star is searched for literally, and a dollar sign in the replacement is not treated as a backreference. The counter is the number of matches, shown as the main figure.
Related tools
- Sentence & Paragraph Counter
Count sentences and paragraphs and see average sentence length — a quick structure check for essays and articles.
- Readability Checker (Flesch-Kincaid)
Score how easy your text is to read: Flesch Reading Ease, Flesch-Kincaid grade, Gunning Fog, SMOG, Coleman-Liau and ARI.
- Word Frequency Counter
Find the most-used words in any text, with counts and percentages — also works as a keyword density checker.
- Morse Code Translator
Translate text to Morse code and Morse back to text using the international standard, with letters, numbers and punctuation.
- Batch Rename Files
Rename many files at once — add numbering, dates, prefixes and suffixes, find and replace (with regex), change case or extension — preview every new name, then download as a ZIP or rename in place.
- Regex Tester
Test JavaScript regular expressions live — see every match highlighted, capture groups, named groups and match positions.