Find and Replace Text

Find and replace every match in your text at once, with optional case-insensitive and regex modes. Plain searches match literally.

Updated

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 capitals, or regex for full pattern matching with capture groups. Your text is edited in the browser and never uploaded.

What the Find and Replace Text does

The tool runs a global find and replace over a block of text. It finds every instance of your search term, puts your replacement in its place, leaves everything else alone and shows you the result to copy.

Use it to swap a word throughout a document or fix a typo that repeats. With the regex option you can also make pattern-based edits across the whole text in one pass.

How it works

The tool searches your text for the term you enter and replaces every match with your replacement. By default it treats the search as a literal string and escapes special characters, so a dot or a question mark matches itself instead of acting as a pattern symbol. The replace is global, so every match changes.

Two options extend it. Ignore case finds the term whatever its capitalisation. Regex mode treats the search as a regular expression, so you can match patterns and reuse capture groups in the replacement (the first group as dollar-one, and so on) for 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 and 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 and references

  • Global replacement: Every occurrence of the search term is replaced, so one 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 and lets the replacement refer to capture groups.
  • Case sensitivity: Searches are case-sensitive unless ignore case is on, in which case the term matches whatever its capitalisation.

Accuracy and limits

A literal find and replace is exact: every occurrence of your search term is replaced and nothing else changes. Because the default mode is literal, special characters can't trip you up.

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

The replacement is global and also hits the term inside longer words. To replace whole words only, use word boundaries in regex mode, since a literal search matches the term wherever it appears.

An empty search leaves the text unchanged, and the tool replaces exactly what you type. There's no undo, so keep your original if you might need it. A literal swap can be reversed by running it again with the two terms switched.

Real-world uses

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 it fits, and when it doesn't

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. Changes across many files belong in your editor's project-wide find and replace. Since this tool applies changes directly, keep a copy of the original.

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 are swapped at once.
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.
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 search and replace run in your browser, so the text you paste stays on your computer.
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

Every occurrence of the search text is replaced. Plain searches match character for character, and the regex option switches on full pattern matching with capture groups.

PopularHot

Word Counter

Count words, characters, sentences and paragraphs as you type, with reading and speaking time alongside.

TextOpen Tool
Trending

Text Diff Checker

Paste two versions of a text and see what changed line by line, with additions in green and removals in red.

TextOpen Tool

Reverse Text

Reverse text by character, by word or by line.

TextOpen Tool
Popular

Case Converter

Switch text between UPPERCASE, lowercase, Title Case, Sentence case, and aLtErNaTiNg with one click per case.

TextOpen Tool
Trending

Lorem Ipsum Generator

Generate placeholder Lorem Ipsum paragraphs, starting with the classic opening line or fully random.

TextOpen Tool

Remove Duplicate Lines

Remove duplicate lines from a list while keeping the first copy of each in its original position.

TextOpen Tool

Back to the Find and Replace Text

Your file is processed on this device and never uploaded, and there's no account to create.