Skip to content
XUtilHub

Find and Replace Text Online (with Regex)

Find and replace words or patterns in any text. Supports case-insensitive, whole-word and regular expression matching with capture groups.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the Find and Replace

Replace every occurrence of a word, phrase or pattern in your text at once. Match whole words only, ignore case, or use regular expressions with $1 capture groups.

Key features

  • Replace all occurrences at once with a live preview
  • Case-insensitive and whole-word matching
  • Regular expressions with $1 and $<name> capture groups
  • Insert new lines and tabs with \n and \t
  • Shows how many replacements were made
  • Works with large texts, entirely in your browser

Find and replace across your whole text

Fix a misspelled name throughout a document, update a product code in a list, swap date formats or clean up exported data, all in one step. The result updates as you type, so you can see the effect before copying it.

Examples

FindReplaceOptionsEffect
colourcolorWhole wordsBritish → American spelling
, \n—One item per line
[ \t]+$(empty)RegexStrip trailing spaces on every line
(\d{4})-(\d{2})-(\d{2})$3/$2/$1Regex2026-10-20 → 20/10/2026
^- RegexAdd a bullet to every line
"'—Switch double quotes to single

Regular expression basics

PatternMatches
\dAny digit
\wLetter, digit or underscore
\sWhitespace
.Any character except a new line
+ / * / ?One or more / zero or more / optional
^ / $Start / end of a line
[abc]Any one of a, b or c
( … )Capture group, reused as $1, $2…

Regular expressions use JavaScript syntax with the m (multiline) and u (Unicode) flags, so ^ and $ match at the start and end of every line.

Tips

  1. Start without regex. Plain text matching is predictable and special characters like . and ( are matched literally.
  2. Test complex patterns first in the Regex Tester, which highlights every match.
  3. Use whole words for names and short terms to avoid partial matches.

Remove whole lines with Remove Lines Containing, or change capitalization with the Case Converter.

How to use the Find and Replace

  1. Type or paste your text into the input box.
  2. Choose the options you want.
  3. The result updates instantly as you type.
  4. Copy the output or download it as a .txt file.

Frequently asked questions

How do I replace text with a new line?

Type \n in the 'Replace with' box. For example, find ', ' and replace with \n to put each comma-separated item on its own line. Use \t for a tab.

What does 'Whole words' do?

It only matches complete words, so replacing 'cat' won't change 'category' or 'concatenate'.

How do capture groups work?

With Regular expression on, parts of the pattern in parentheses are captured and can be reused: find (\w+)@(\w+) and replace with $2: $1. Named groups (?<name>…) are referenced with $<name>, and $& inserts the whole match.

Can I undo a replacement?

Your original text is never changed. The result appears in the output box, so you can adjust the options until it looks right.

Is my text sent anywhere?

No. All text tools run locally in your browser.

Do these tools support Unicode?

Yes. They handle Unicode text, including emoji and accented characters.

Last updated:

Related Text tools