Skip to content
YouNeed Tools
Free VPN

Find and Replace

Replace every copy of a word or phrase in one go, or use a regular expression to change patterns such as dates, prices or codes.

Type what to find.

Replaced on your device. Your text isn’t sent anywhere.

Worked example: whole words and reordered dates

In “The cat sat by the category list; Cat food is in the catalog.”, a plain replacement of cat with dog makes 4 changes and damages two words: “The dog sat by the dogegory list; dog food is in the dogalog.”. With whole words only ticked it makes 2 changes: “The dog sat by the category list; dog food is in the catalog.”. To turn ISO dates into US order, use the regular expression (\d{4})-(\d{2})-(\d{2}) with the replacement $2/$3/$1: “Invoice 3 is due 2026-12-01 and invoice 4 is due 2027-01-15.” becomes “Invoice 3 is due 12/01/2026 and invoice 4 is due 01/15/2027.”.

Regular expression cheat sheet

PatternMatches
\d / \d+One digit / a whole number
\s+Any run of spaces, tabs or line breaks
^ and $The start and end of each line
colou?r“color” and “colour” (the u is optional)
(Mr|Mrs|Ms)\.Any of the three titles, captured as $1
[A-Z]{2}\d{4}Two capitals then four digits, like AB1234
\p{L}+A word in any alphabet

Useful clean-ups: replace [ \t]+$ with nothing to strip spaces at line ends; replace \n{3,} with \n\n to collapse runs of blank lines; replace \s*,\s* with , to tidy commas.

Why a time limit?

A regular expression engine tries every way a pattern could match before giving up. For most patterns that is instant, but a pattern like (a+)+$ on a long line of a’s ending in another letter has to try an exponential number of combinations, which can freeze a browser tab for minutes. This is known as catastrophic backtracking, and it has taken down real websites. Here each search runs apart from the page and is stopped after two seconds, and a warning appears as you type when a pattern has the risky shape of a repeated group inside another repetition.

Plain replacements are literal

Without “Regular expression” ticked, every character means itself: a full stop is a full stop and $1 in the replacement is the text “$1”. That makes plain mode safe for replacing prices, file paths and code, where symbols would otherwise have special meanings.

Real jobs for find and replace

  • Rebranding a document: replace an old product or company name everywhere, with whole words on so that longer words containing it are left alone.
  • Cleaning exported data: remove currency signs, change semicolons to commas, or strip “Mr”, “Mrs” and “Ms” from a list of names with a single pattern.
  • Templates: fill placeholders such as {name} or [DATE] in a letter or e-mail before sending it.
  • Code and configuration: rename a variable, change a URL in every line, or reorder captured parts with $1 and $2.

Check the highlighted matches before you copy the result: they show exactly which parts of the text will change, and the count tells you whether the pattern caught more or fewer places than you expected.

Related tools

Sources

Checked on November 26, 2026:

Frequently asked questions

How do I find and replace text online?
Paste your text, type the word to find and its replacement. Every match is highlighted and counted, and the result with all of them replaced appears below, ready to copy or download.
What does “whole words only” do?
It replaces “cat” but not the “cat” inside “category” or “catalog”. A match counts as a whole word when there is no letter, digit or underscore right before or after it, which also works for accented letters.
How do I use a regular expression?
Tick “Regular expression” and type a pattern, such as \d+ for any number. Wrap parts in brackets to capture them and use $1, $2 in the replacement to put them back, for example to reorder dates. The syntax is the one used by JavaScript, which most code editors also understand.
Why was my search stopped?
Some patterns, typically a repeated group inside another repetition such as (a+)+, can take an extremely long time on certain text. The search runs separately from the page and is stopped after two seconds, so the page keeps working. Make the pattern more specific and try again.
Can I add a new line in the replacement?
In regular expression mode, type \n for a new line and \t for a tab. In plain mode the replacement is used exactly as typed.
Is my text sent anywhere?
No. The search and replace run on your device.

Last updated: 2026-11-26