Menu

Find and Replace Online

Paste your text, type what to find and what to put in its place, and the result updates as you type, with the number of replacements made.

0 words 0 characters 0 lines

Continue with this text: Remove lines containingCompare before and afterWord counter

Your text stays in your browser: nothing is uploaded or stored on a server.

How to use it

  1. Paste your text in Your text, open a .txt or .csv file with Open file, or click Example to load a sample sentence.
  2. Type the word or phrase to look for in Find and the new text in Replace with. Leave Replace with empty to delete every match.
  3. Set the options: Match case, Whole words only, Regular expression ($1 for groups) and Use \n and \t for line breaks and tabs (in Find and Replace with).
  4. Read the result and the count next to it, such as “2 replacements”. The result updates on every keystroke, so a count of 0 tells you at once that the search found nothing.
  5. Click Copy or Download .txt, or Use as input to run another replacement on the result.

Spaces in the Find field count. cat with a trailing space is a different search from cat, and the tool does not trim it.

What each option changes

The example text is The color of the sky changes. Colors fade at dusk, but the color returns at dawn. with Find color and Replace with colour:

Options Result Count
Whole words only (default) The colour of the sky changes. Colors fade at dusk, but the colour returns at dawn. 2
Whole words off The colour of the sky changes. colours fade at dusk, but the colour returns at dawn. 3
Whole words off, Match case on The colour of the sky changes. Colors fade at dusk, but the colour returns at dawn. 2
  • Match case off (the default) finds color, Color and COLOR. Case folding works for any alphabet, so αθηνα also finds ΑΘΗΝΑ. The replacement is always inserted as typed: Colors became colours above, losing its capital.
  • Whole words only stops a match from running into a neighboring word: if the match starts with a letter, digit or underscore, the character before it must not be one, and the same applies to the end. It uses Unicode letters, so cafe does not match inside café, and color does match in color-blind because a hyphen is not a letter. It also applies in regex mode.
  • Regular expression treats Find as a pattern and lets you reuse captured groups in the replacement (see below). With it off, characters such as ., *, ( and $ are searched for literally, and $1 in Replace with is inserted as the text $1.
  • Use \n and \t turns \n into a line break, \t into a tab and \\ into one backslash in Replace with, and in Find when Regular expression is off (a regular expression reads \n and \t itself).

The rules and edge cases

Whole words and punctuation. The check only applies at an end of the search that is a letter, digit or underscore. A search that starts or ends with punctuation or a space has nothing to check on that side, so these work with the option on:

Text Find Replace with Result
a, b, c , ; a;b;c
[email protected] @old.com @new.com [email protected]
Wait... what ... … Wait… what

Fragments of words still need the option off: cat → dog turns cat category into dog category, and ing finds nothing in going until you untick it.

Numbers. Whole words treats a period as a boundary, so 12 → 14 turns Room 12, 120 and 12.5 into Room 14, 120 and 14.5: 120 is left alone but the 12 in 12.5 changes.

Matches do not overlap. The text is scanned left to right and each match is replaced once. With Whole words only off, aa → b on aaaa gives bb (2 replacements), not three.

Emoji and accents. Outside regex mode, a match never splits a character: it does not stop before a skin-tone modifier, an accent typed as a separate mark, a variation selector or an emoji joiner. 👍 → (thumbs up) turns Great 👍 job 👍🏽 into Great (thumbs up) job 👍🏽, leaving the toned emoji alone, and ❤ matches a plain ❤ but not the red-heart form ❤️. Copy the exact emoji from your text into Find to replace a toned or combined one.

Empty Find. Nothing changes and the count is 0.

Regular expressions and $1 groups

With Regular expression ticked, Find is a JavaScript pattern and every match in the text is replaced. Wrap parts of the pattern in parentheses and refer to them as $1 to $99; $& or $0 inserts the whole match. These examples were run with Whole words only on:

Text Find Replace with Result
Due 2026-10-21 and 2026-11-05. (\d{4})-(\d{2})-(\d{2}) $2/$3/$1 Due 10/21/2026 and 11/05/2026.
Smith, John (\w+), (\w+) $2 $1 John Smith
apple banana \w+ [$&] [apple] [banana]
red, green and blue red|green|blue color color, color and color

Details worth knowing:

  • ^ and $ mean the start and end of each line, so ^ → - on three lines adds a dash to each (3 replacements), and $ → ; ends every line with a semicolon. The prefix and suffix tool does the same without a pattern.
  • . does not match a line break, so a pattern never runs across lines unless you include \n.
  • $10 is group 10 when the pattern has ten groups, and otherwise $1 followed by 0. $$ inserts a dollar sign, $<year> fills in a named group such as (?<year>\d{4}), and a group that matched nothing inserts nothing.
  • Escapes such as \- and \# outside square brackets, which strict Unicode mode rejects, are read as a plain - and #. An invalid pattern shows a short reason, such as “Invalid regular expression: unterminated group”, in place of the count and leaves the result empty.

Line breaks, tabs and lists

The \n option and regex mode handle the most common list chores, with Whole words only left on.

Turn a column of values into a comma-separated line (Find \n with either Regular expression or the \n option ticked, Replace with , ):

apple
banana
cherry

becomes apple, banana, cherry (2 replacements).

Wrap each line in quotes for an SQL IN list (Regular expression on, Find (.+), Replace with '$1',):

'apple',
'banana',
'cherry',

Going the other way, Find , with Replace with \n and the \n option ticked splits a, b, c onto three lines. Replace ; with \t to turn semicolon-separated text into tab-separated columns that paste into separate spreadsheet cells. For paragraphs broken at every line by a PDF, the line break remover keeps paragraph breaks for you; the guide on fixing PDF line breaks explains why it happens.

When people need it

  • Spelling and naming changes: US to UK spelling in a document, a renamed product, a new company name or a changed email domain (@old.com → @new.com).
  • Straight quotes for code or CSV: regex [“”] → " turns curly double quotes into straight ones.
  • Cleaning exports: removing a repeated label, tracking code or separator from data copied out of a CRM or spreadsheet.
  • Rewriting dates and names with groups, as in the table above, before importing into another system.

After a large replacement, paste the old and new versions into the text compare tool to check every change, and use the remove lines containing tool when whole lines should go rather than single words.

Questions

Why does it say 0 replacements when the text is clearly there?

Usually because Whole words only is ticked (it is on by default) and you are searching for part of a word, such as cat inside category or ing. Untick it for word fragments. Other causes are Match case with a different capitalization, a stray space in Find, or an emoji that carries a skin tone in the text but not in Find.

Can I replace several different words at once?

One run uses one search and one replacement. If the words share a replacement, tick Regular expression and separate them with |, as in red|green|blue. For different replacements, run the first one, click Use as input, then change the Find and Replace with fields for the next one. Undo brings the previous input back.

Does the replacement keep the original capitalization?

No. The replacement is inserted exactly as you type it, so with Match case off, Color and COLOR both become colour. Tick Match case and run once per spelling if you need Colour and COLOUR.

How do I replace text with a line break?

Tick Use \n and \t for line breaks and tabs and type \n in Replace with. The same option lets you type \n in Find to search for line breaks; with Regular expression ticked, \n in Find already means a line break.

How do I delete a word everywhere?

Leave Replace with empty. Deleting very from This is very very good. leaves extra spaces (This is good.); search for very with a trailing space to get This is good., or clean up with the extra space remover.

Is my text uploaded anywhere?

No. The search and replace runs in your browser and nothing is sent to a server. The text stays in this browser tab so it carries over if you open another tool, and it is gone when you close the tab.

Which regular expression syntax does it use?

JavaScript regular expressions in Unicode mode, applied to every match in the text. Groups are written $1 to $99 (or $<name>) in the replacement, $& (or $0) is the whole match and $$ is a dollar sign. ^ and $ mean the start and end of each line.