Find and Replace Text

Find and replace text — every match at once, with optional case-insensitive and regex modes — instantly in your browser. Plain text is matched literally.

Text Tools Free No upload Instant

Loading Find and Replace Text…

Your browser is preparing the tool. It runs 100% locally.

Quick Answer

Enter what to find and what to replace it with, and the tool swaps every occurrence in your text at once. By default the search is a literal string, so special characters match themselves. Tick ignore case to match regardless of capitalisation, or regex for full pattern matching with capture groups. Everything runs in your browser; nothing is uploaded.

What the Find and Replace Text Does

This tool performs a global find and replace over a block of text. It locates every instance of your search term and substitutes your replacement, leaving the rest of the text untouched, and shows you the result to copy.

It is the quick way to swap a word throughout a document, fix a repeated typo, or — with the regex option — make pattern-based edits across the whole text in one go.

How It Works

The tool searches your text for the term you enter and replaces every match with your replacement. In its default mode it treats the search as a literal string, escaping any special characters so they match themselves rather than acting as pattern symbols. The replace is global, so all matches change, not just the first.

Two options extend it. Ignore case matches the search term regardless of capitalisation. Regex mode treats the search as a regular expression, so you can match patterns and reference capture groups in the replacement — the first group as dollar-one, and so on — for powerful, structured edits.

Processing pipeline

  1. Read find and replace. Take the search term and the replacement text you enter.
  2. Build the matcher. Use the literal text as-is, or a regular expression if regex mode is on, applying ignore-case if set.
  3. Replace every match. Swap every occurrence in the text with the replacement, globally.
  4. Show the result. Return the edited text for you to copy.

How it replaces

default : the search is a literal string (special characters match themselves) regex : the search is a regular expression (patterns + capture groups, dollar-one in the replacement) ignore case : match regardless of capitalisation all replacements are global (every match)
Worked example
find cat, replace dog, in the cat sat → the dog sat · regex find a digit run, replace #, in a1 b22 → a# b#

Without regex, the search matches literally, so a dot matches a dot. With regex on, you get full pattern matching and can reuse captured groups in the replacement.

Standards & references

  • Global replacement — Every occurrence of the search term is replaced, not just the first, so a single operation updates the whole text consistently.
  • Literal versus regex — By default the search is literal, with special characters escaped so they match themselves. Regex mode treats the search as a pattern, enabling matches and capture-group references in the replacement.
  • Case sensitivity — Searches are case-sensitive unless the ignore-case option is on, which matches the term regardless of capitalisation.

Accuracy & Limitations

For literal find-and-replace, the result is exact: every occurrence of your search term is replaced, and nothing else is touched. The default literal mode means you do not have to worry about special characters.

Regex mode is powerful but unforgiving. A pattern that matches more than you intend will replace more than you intend, so check a regular expression on a copy first. Capture groups, referenced as dollar-one and so on, let you keep parts of the match in the replacement.

Replacement is global and applies across the whole text, including inside words unless your pattern prevents it. To replace whole words only, use word boundaries in regex mode, since a literal search will also match the term inside longer words.

An empty search leaves the text unchanged, and the tool replaces based on what you type exactly. It does not undo, so keep your original if you might need it — though you can simply re-run with the terms swapped to reverse a literal change.

Real-World Use Cases

Swapping a word

Replace a term throughout a document at once.

Fixing a repeated typo

Correct the same mistake everywhere it appears.

Pattern edits

Use regex to change anything matching a pattern.

Reformatting with groups

Rearrange matched parts using capture groups.

When to use it — and when not to

Good for

  • Replacing every occurrence of a term
  • Literal text swaps without surprises
  • Case-insensitive replacement
  • Pattern-based edits with regex and groups

Not the best choice for

  • Whole-word-only replacement without regex
  • Previewing changes before applying
  • Replacing across multiple files at once
  • Undoing after the fact

For whole-word replacement, turn on regex and use word boundaries. For changes across many files, use your editor's project-wide find and replace. Keep a copy of the original, since this applies changes directly.

Frequently Asked Questions

Does it replace every match or just the first?
Every match. The replacement is global, so all occurrences of the search term in the text are swapped at once, not only the first one.
Is the search case-sensitive?
By default, yes. Turn on ignore case to match the term regardless of capitalisation, so Cat and cat are both found and replaced.
What is the difference between literal and regex modes?
In literal mode the search matches exactly, with special characters escaped so they match themselves. In regex mode the search is a regular expression, so you can match patterns and use capture groups in the replacement.
Do special characters work in a normal search?
They are matched literally. A dot matches a dot and a question mark matches a question mark, because the literal mode escapes special characters. Switch on regex if you want them to act as pattern symbols.
How do I keep part of the match in the replacement?
Use regex mode with capture groups. Wrap the part you want to keep in parentheses in the pattern, then reference it in the replacement as dollar-one for the first group, dollar-two for the second, and so on.
How do I replace whole words only?
Turn on regex and put word boundaries around your term. A literal search will also match the term inside longer words, so word boundaries restrict it to standalone words.
Can I delete text instead of replacing it?
Yes. Leave the replacement field empty and every match of the search term is removed, which is just a replacement with nothing.
What happens if my search is empty?
The text is left unchanged. There is nothing to find, so the tool returns your text as it was.
Can I undo a replacement?
There is no undo. Keep your original text if you might need it. For a literal swap, you can reverse it by running find and replace again with the two terms swapped.
Why did it replace text inside a word?
Because a global search matches the term wherever it appears, including inside longer words. To avoid that, use regex mode with word boundaries so only standalone words match.
Is my text uploaded?
No. The find and replace runs entirely in your browser. Nothing is sent to a server, so your text stays on your device.
Does regex mode support flags like multiline?
It applies a global match, and ignore case when that option is on. For other behaviour, build it into the pattern itself, since the search is treated as a regular expression.

References

Replaces every occurrence of the search text with the replacement; plain searches match literally, and the regex option enables full pattern matching with capture groups.

PopularHot

Word Counter

Clean and transform text with Word Counter — instant results, fully in-browser.

TextOpen Tool
Popular

Character Counter

Character Counter instantly as you type — free, private and lightning fast.

TextOpen Tool
Popular

Case Converter

Case Converter instantly as you type — free, private and lightning fast.

TextOpen Tool
Trending

Lorem Ipsum Generator

Clean and transform text with Lorem Ipsum Generator — instant results, fully in-browser.

TextOpen Tool
Trending

Text Diff Checker

Text Diff Checker online with no limits, no signup and no data leaving your browser.

TextOpen Tool

Remove Duplicate Lines

Remove Duplicate Lines online with no limits, no signup and no data leaving your browser.

TextOpen Tool

Ready to try the Find and Replace Text?

It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.