Find and replace text
Paste your text, type what to find and what to replace it with, and copy the result. Options for case, whole words and regular expressions. Nothing is uploaded.
Free · no signup Runs in your browser
How do I find and replace text online?
Paste your text, type the word or phrase to find and what to replace it with, and the replaced text appears at once with a count of matches and a highlighted preview. Tick Match case or Whole word as needed. Tick Regular expression to use patterns, where $1 in the replacement stands for the first group. Everything is done in your browser.
More than a replace box
A word processor's find and replace works inside the document you have open. Sometimes the text is in a form, an email, a spreadsheet cell or a code editor with no such feature. Pasting it here lets you replace every match in one go and see exactly what changed.
The highlighted preview shows the matches in the original text before you copy the replacement, so you can catch a pattern that matched more than you meant. 'Whole word' stops 'cat' from matching inside 'category'. 'Match case' separates 'US' from 'us'. Regular expression mode lets you match patterns instead of fixed text, for example the digits of a phone number or a date, and use groups in the replacement.
It runs in your browser. What you paste is never sent anywhere, and there is no sign-up.
How it works in detail
In the default plain mode the text you type in 'Find' is searched for exactly as typed, so characters such as a dot, a bracket or a dollar sign have no special meaning. 'Match case' is off by default, so Cat, cat and CAT all match; tick it to match only the exact case. 'Whole word' makes a match count only when it is not touching a letter, digit or underscore on either side, so 'cat' does not match inside 'concatenate'. 'Regular expression' switches to pattern matching with JavaScript's rules and Unicode support, and in the 'Replace with' box $1, $2 and so on stand for the groups you captured and $& for the whole match. Every match is replaced at once, and the count and a highlighted preview show what was found. A pattern that could match an empty string is skipped, to avoid endless loops.
How to use it
- Paste your text into the first box.
- Type what to find, and what to replace it with (leave the second box empty to delete the matches).
- Tick Match case or Whole word if you need them. Tick Regular expression only if you want pattern matching.
- Check the number of matches and the highlighted preview.
- Copy the replaced text from the result box.
What changes and what stays the same
What the tool does to your text, and what it leaves alone.
| Aspect | What happens |
|---|---|
| Text outside the matches | Unchanged |
| Case of the replacement | Inserted exactly as you typed it |
| Number of replacements | Shown, so you can see that nothing unexpected changed |
| Special characters in plain mode | Treated as ordinary characters |
| Your original text | Still in the first box until you change it |
| Privacy | The text stays in your browser: it is not uploaded, saved or logged |
When to use it
- Replacing a name or term throughout a long text
- Changing a date or number format using a pattern
- Cleaning up text before you paste it somewhere
- Checking how many times a word appears
Problems you may run into
Most problems come from the text you paste, not from the tool.
| What you see | Likely cause | What to do |
|---|---|---|
| Zero matches | The text differs by case, spacing or punctuation, or Whole word is on | Untick Match case and Whole word, and check the spelling and spaces |
| Too many matches | The find text is a part of other words | Tick Whole word, or make the find text longer |
| The replacement shows $1 literally | Regular expression is off, or the pattern has no group | Tick Regular expression and put the part to keep in brackets |
| 'Invalid pattern' | A regular expression has a syntax error, such as an unclosed bracket | Fix the pattern, or untick Regular expression to search for the text as typed |
| The page freezes | A very complicated pattern on very long text | Simplify the pattern or work on smaller sections |
| Line breaks do not match | In a pattern, a line break is \n | Use \n in regular expression mode |
Mistakes it helps you avoid
- Replacing part of a longer word: use Whole word.
- Missing matches because of capital letters: leave Match case off.
- Using special characters in plain mode: they are treated literally unless you choose regular expressions.
- Replacing without looking: check the preview first.
How it works
Everything happens in your browser as you type.
plain mode = your text is searched for exactly as typed (special characters have no special meaning)whole word = a match must not touch a letter, digit or underscore on either sidematch case = off by default, so Cat, cat and CAT all matchregular expression = the pattern follows JavaScript rules; $1, $2 are groups and $& is the whole match in the replacementresult = every match replaced; the number of matches is shown
Regular expressions use the JavaScript syntax with Unicode support. A pattern that can match an empty string is skipped to avoid endless loops. Very complicated patterns on very long texts can be slow, since they run on the page itself.
Example: changing a name
You replace 'colour' with 'color' in the text 'The colour of the colourful car.' using Whole word.
- Findcolour
- Whole wordon
- Matches1 (colourful is not matched)
The color of the colourful car.
Without Whole word, colourful would also change.
Terms on this page
- Regular expression
- A pattern that describes text to match, such as three digits in a row.
- Capture group
- A part of a pattern in brackets whose match can be reused as $1, $2 and so on.
Common questions
How do I replace only whole words?
Tick 'Whole word'. A match then cannot touch a letter, digit or underscore on either side.
Can I use regular expressions?
Yes. Tick 'Regular expression'. Use $1 for the first group and $& for the whole match in the replacement.
Why did it not find my text?
Check Match case, and in plain mode remember that characters such as . and * are searched for literally.
Is my text uploaded?
No. It is processed in your browser and never sent anywhere.
Does it replace every match?
Yes. All matches are replaced, and the count is shown.
Where these numbers come from
- MDN Web Docs — Regular expressions The pattern syntax used in regular expression mode.
- MDN Web Docs — String.prototype.replace() How matches are replaced, including $1 and $&.
- MDN Web Docs — Clipboard API How a page copies text to your clipboard when you press a button.
Last verified 2026-10-25 The method on this page is checked against the sources above at least once a year. Spotted something out of date? Tell us and we will fix it.
Related tools
Remove line breaks
Join broken lines into paragraphs or remove every line break from text, such as text copied from a PDF or an email.
Open toolText compare
Paste two versions of a text and see what was added and removed, by word or by line.
Open toolCase converter
Change text to UPPER, lower, Title, Sentence, camelCase, snake_case, kebab-case and more, and copy the result.
Open toolMarkdown to HTML
Turn Markdown into clean HTML with a live preview: headings, bold, italic, links, images, lists, code and quotes. Raw HTML in the input is shown as text.
Open toolEmail extractor
Pull every email address out of pasted text, remove duplicates, sort them and count the domains. Private: nothing leaves your device.
Open toolRegex tester
Test a regular expression against your text, see the matches and groups highlighted, and preview a replacement. A runaway pattern is stopped safely.
Open tool📝 Text tools
Small text jobs done in your browser: counting, converting, comparing and cleaning. What you type never leaves your device.
See all 17 tools in this section