UtilDojo

Popular

Menu

Find and Replace Text Online

  • This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.

Text

Result

Result appears here.

About this tool

Paste your text, type what to find and what to replace it with, and the result updates as you type, along with how many replacements were made. Your original stays in the left box, and the replaced version appears on the right for you to copy or download.

“Whole word” replaces “cat” without touching “category”, and works for Hindi and accented words too. “Match case” makes the search case-sensitive; without it, “Cat”, “cat” and “CAT” are all found. In plain mode your search is taken literally, so characters like ., ( and * are matched as typed.

Turn on Regex for patterns: replace every number with \d+, swap “Last, First” into “First Last” with ([^,]+), (.+) → $2 $1, or remove anything between brackets with \(.*?\) and an empty replacement. A real example is cleaning an exported list: search for ^\s+ to strip leading spaces, or for \s{2,} to turn runs of spaces into one.

Some pitfalls are worth knowing. A regex that can match nothing, such as a*, will report many empty matches. An invalid pattern shows an error message instead of changing your text. In regex mode a $ in the replacement is special ($1, $&, $<name>, and $$ for a literal dollar), so to insert a price such as $5 write $$5. In plain mode the replacement is inserted exactly as typed. Everything runs in your browser and nothing is uploaded.

Frequently asked questions

How do I use capture groups?

Enable Regex, wrap parts of the pattern in parentheses, and refer to them as $1, $2… in the replacement. Named groups (?<name>…) can be used as $<name>.

Can I replace line breaks?

Yes — enable Regex and search for \n to match line breaks.

Is the replacement applied to my original text?

Your input is left untouched; the replaced version appears on the right for you to copy or download.

Does it replace every match or just the first?

Every match in the whole text is replaced in one pass, and the heading above the result shows the count, for example “12 replaced”.

How do I delete text instead of replacing it?

Leave the “Replace with” box empty. Each match is removed, which is handy for stripping a repeated prefix, a tag or bracketed notes.

Is the search case-sensitive?

Not by default. Tick “Match case” if “Apple” and “apple” should be treated differently.

Why does my regex show an error?

The pattern is not valid, for instance an unclosed bracket or a stray ( or *. Fix the pattern, or turn Regex off if you meant to search for those characters literally.

Read the guide

Related tools