Find and Replace
Swap one string for another across a whole block of text, literally or by pattern.
What this tool does
Find and Replace reads the text you paste and rewrites every occurrence of one string as another. Two matching modes sit behind the same box: a literal search, which treats what you type as plain characters, and a regular expression search, which compiles your pattern with the browser's own JavaScript engine. The rewritten text appears in a second pane, with a line underneath saying how many matches were changed or that none were found.
Three switches shape a literal match. Case sensitive is off by default, so colour and Colour are both found by the same query. Whole words only skips a match sitting inside a longer word, which is what stops cat from rewriting catalogue. Replace the first match only stops after a single change. The replacement box does a fourth job on its own: leave it empty and each match is deleted instead of swapped, which turns this into a bulk edit for stripping a repeated string out of a document. Ticking the regular expression box adds two more: Multiline mode, on by default, anchors ^ and $ to each line rather than to the whole block, and Dot matches newlines lets a full stop cross a line ending. In that mode the replacement also understands JavaScript's substitution syntax — $1 and $2 insert capture groups,
amp; inserts the whole match, and $ writes a literal dollar sign. Literal mode does none of that: the replacement goes in exactly as typed, so $5.00 stays $5.00.Four limits are worth knowing before you trust the output. A case-insensitive run does not restore the case it found — replacing colour with color turns Colour into color rather than Color, because the replacement is inserted verbatim. Whole words only behaves differently in the two modes: the literal search counts a letter or digit in any script as part of a word, while the regular expression version wraps your pattern in JavaScript's \b, which recognises only A–Z, 0–9 and underscore, so a word ending in an accented letter will not match there. One character defeats the literal search outright: İ, the Turkish dotted capital I, folds to two characters when the tool lowercases the text for an insensitive comparison, which shifts every position after it by one and hands back the text around a match scrambled — on anything containing that letter, tick Case sensitive or use regular expression mode. And a run takes one Find and one Replace with at a time; your original is left sitting in the input box, but nothing marks up which matches are about to change, and a second substitution means copying the output back over the input by hand.
None of your text leaves the tab. The input is a text box rather than a file picker, the matching and the rewriting happen in this browser, and neither the text nor the settings are transmitted anywhere — which is the practical reason to use it on a contract, a customer export or a config file carrying credentials. The cost is memory: a few megabytes of text is comfortable, and a very large paste will make the tab slow to respond while it works.
How to use it
- Paste the text. Type into the input box or press Load sample, which loads three lines carrying colour twice on its own, once hyphenated in colour-blind, and once capitalised inside the longer word Colourful. There is no file picker; this works on text you paste.
- Fill in Find and Replace with. Find takes plain characters by default. Leaving Replace with empty is deliberate — every match is deleted rather than swapped. An empty Find box is refused with a message.
- Narrow the match. Case sensitive separates Colour from colour, Whole words only keeps cat out of catalogue, and Replace the first match only changes a single occurrence and leaves the rest alone.
- Switch to a regular expression when a pattern is needed. Tick Treat “Find” as a regular expression for something like (\d{4})-(\d{2})-(\d{2}), then write $3/$2/$1 in the replacement to reorder the parts. An invalid pattern is reported with the engine's own parse error.
- Check the count, then copy. The hint under the output says how many matches were replaced. Reading it before you copy is the quickest way to catch a pattern that matched far more, or far less, than you meant.
Processing & privacy
Runs on your device. Your file is processed directly in this browser.
Common use cases
Renaming an identifier across a file
Whole words only confines the change to the identifier itself, so renaming id leaves width, video and invalid untouched.
Anglicising or Americanising a document
One pass per word swaps colour for color or organise for organize, with case sensitivity off so the capitalised occurrences are caught in the same run.
Reformatting a column of dates
A pattern with three capture groups turns 2024-05-06 into 06/05/2024 down every row of a pasted export, which no literal search can do.
Stripping something repeated
Leave the replacement empty to delete a tracking parameter, a leading prefix or a stray character from every line at once.
Filling in a message template
Paste a draft holding {{name}} and {{date}} and put the real values in, one token per run, before it goes out.
Questions
Is my text uploaded anywhere?
Why did Colour come back as color rather than Color?
Can I replace several different words in one go?
Which regular expression syntax works here?
Does it search the text it has just written?
Is there a ceiling on how much it will replace?
What happens when the pattern is wrong?
Related tools
- Word Counter — Count words, characters, sentences and reading time.
- Case Converter — Switch between upper, lower, title, camel and snake case.
- Remove Line Breaks — Collapse hard wraps back into flowing paragraphs.
- Remove Extra Spaces — Normalise double spaces and stray whitespace.
- Sort Lines — Sort lines alphabetically, numerically or randomly.
- Remove Duplicate Lines — Delete repeated lines from a list.