Skip to content

Tool 01 / Replace

Find and replace, without the guesswork.

Swap a word, rename a product, or rewrite a pattern across thousands of lines. Keep the original visible, see the count, and copy the result when it looks right.

  • Free to use
  • Regex support
  • Runs locally
Live workbench3 matches
Search options

Replacements update as you type. Turn on the regular expression option for patterns.

Result
3 matches3 replaced127 in142 outNever uploaded

What it does

Find and replace is the most-used text operation that nobody talks about. You have a document, a list, or a block of code; one string needs to become another string, everywhere it appears. This tool performs that swap in your browser, updating the result as you type.

There are two modes. Literal mode treats the search as plain text, so a dot is a dot and a dollar sign is a dollar sign. Regular expression mode treats the search as a JavaScript pattern, which lets you match dates, email addresses, repeated whitespace, or anything else with a shared shape.

The original text stays in the left box until you clear it. The right box is a live preview, not a destructive edit, so a bad replacement costs nothing. The match counter tells you whether the pattern found what you expected before you copy anything.

How to use it

  1. Paste the text you want to change into Your text. The box accepts multiple lines, tabs, and Unicode.
  2. Type the search into Find. For a plain word or phrase, leave Regular expression off.
  3. Type the replacement into Replace with. Leave it empty to delete the match.
  4. Turn on the options that match your intent — most often Match case or Regular expression. The badge at the top shows how many matches exist.
  5. Check the right-hand result, then use Copy or Download. The file is saved as plain UTF-8 text.

If the counter says zero, the problem is almost always one of three things: the case does not match, whole-word mode is excluding part of a word, or a regex character such as a dot or bracket is being read as syntax.

Options, explained

Match case
Off by default, so acme matches Acme and ACME. The replacement itself is not case-adjusted: it is inserted exactly as typed. Turn this on when you only want the exact spelling changed.
Whole words
Adds word boundaries around the search, so cat matches the word in “the cat sat” but not the middle of “concatenate”. In regex mode the boundaries are wrapped around your whole pattern. The boundaries are ASCII-based — see the limits below.
Regular expression
Reads the Find field as a JavaScript regex. Capture groups can be referenced in the replacement as $1, $2, or $<name> for named groups. Use $& for the entire match and $$ for a literal dollar sign.
First match only
Replaces the first occurrence and leaves the rest alone. The counter still reports every match, so you can see how many were skipped.
Multiline anchors
Changes what ^ and $ mean in a regex: with this on they match the start and end of each line instead of the start and end of the whole text. It does not make the dot match line breaks.
Interpret \n and \t
Converts the two-character sequences \n and \t in the replacement into a real newline or tab. Handy for turning a comma-separated list into one item per line. It applies to both literal and regex replacements.

Examples

These are the patterns people reach for most often. Every example assumes the options named in the caption; a pattern that looks right with the wrong flag will silently match nothing.

Rename a product
Literal · match case

Before

Acme analytics
Acme billing
Billing for Acme

After

Northwind analytics
Northwind billing
Billing for Northwind

Find Acme, replace with Northwind, and turn on Match case. With case matching off, a lowercase acme in an email address would be renamed too, which is rarely what you want.

Reformat dates with capture groups
Regex on

Before

2026-10-27 · draft
2026-11-03 · review
2026-11-10 · publish

After

27/10/2026 · draft
03/11/2026 · review
10/11/2026 · publish

Find (\d{4})-(\d{2})-(\d{2}) and replace with $3/$2/$1. Each parenthesised group is captured in order; the replacement puts day first. Add \b around the pattern if the dates sit inside longer identifiers.

Redact email addresses
Regex on

Before

Write to [email protected]
Escalate to [email protected]

After

Write to [email]
Escalate to [email]

Find [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,} and replace with [email]. This is a practical redaction, not a validator: it will also catch addresses that are not deliverable, and it will miss unusual valid ones. Check the count against the number of addresses you expected.

When it earns its keep

  • Rebranding copy. Replace a company, product, or plan name across a page without touching the surrounding prose.
  • Preparing data for import. Turn semicolons into tabs, empty cells into NULL, or decimal commas into decimal points before a spreadsheet import.
  • Cleaning logs. Strip timestamps, thread IDs, or ANSI color codes with a regex before pasting an excerpt into a bug report.
  • Redacting a sample. Replace real names, email addresses, or account IDs with placeholders before sharing a document.
  • Editing a generated list. Change a repeated prefix, remove a trailing comma, or turn one delimiter into another.

Limits worth knowing

  • It is JavaScript regex, not PCRE. Lookbehind works in current browsers, but constructs such as \A, possessive quantifiers, and recursive patterns do not. Test the pattern on a small sample first.
  • Catastrophic backtracking is real. A broad pattern with nested quantifiers can freeze a tab on the wrong input. If the page stops responding, close the tab; nothing was saved.
  • Word boundaries are ASCII. \b treats accented letters as non-word characters, so whole-word mode can behave surprisingly with “café” or with non-Latin scripts. Use a regex with explicit boundaries instead.
  • No case preservation. The replacement is inserted as typed. If you need to keep “Title case” vs “lowercase” variants, run separate, case-sensitive replacements.
  • Line endings are left alone. Windows CRLF text keeps its CRLF line endings. If you need to normalize them first, run the text through Clean Text before replacing.
  • It is a text tool, not a file editor. Binary files, very large logs, and rich-text formatting are outside its scope. The practical ceiling is your browser’s memory.

Page updated

Questions, answered

Is my text sent to a server when I replace it?

No. The replacement runs as JavaScript in your browser. Nothing is posted, saved, or logged by this site, and the text disappears when you close the tab.

Can I use regular expression capture groups?

Yes. Turn on Regular expression and use $1, $2, or a named group like $<year> in the replacement. In literal mode the replacement is treated as plain text, so a dollar sign stays a dollar sign.

How do I replace a word with nothing?

Leave the Replace with field empty. Every match is deleted while the rest of the text stays as it was.

How do I insert a line break in the replacement?

Type \n in the replacement and turn on “Interpret \n and \t”. The two characters are converted into a real line break. A literal newline cannot be typed into the single-line field.

Why does “whole words” fail on accented or non-Latin text?

Whole-word mode uses JavaScript word boundaries, which are based on ASCII letters, digits, and underscores. Accented letters and scripts such as Chinese or Arabic do not follow those rules. In that case, leave whole-word off and describe the boundary with a regex instead.

Does the tool preserve the original capitalization?

No. The replacement is inserted exactly as typed. Replacing “acme” with “Northwind” produces “Northwind” everywhere, including where the original was “Acme”. For a one-off rename that usually does not matter, but check the result before copying.

All tools →