Skip to main content
ToolsHub

Find and Replace Text

Replace all occurrences of any text instantly. Supports regex patterns, case sensitivity, and whole-word matching. See match count and replacements made.

Files never leave your browser

How to use Find and Replace Text

The Find & Replace tool performs bulk search-and-replace operations on any block of text, with support for literal string matching, case-insensitive matching and full regular expression patterns. It shows a live preview of every match before applying changes, displays a replacement count, and handles multi-line text and Unicode characters correctly — making it ideal for bulk editing data exports, template files and large documents without opening an IDE.

  1. Paste the text you want to edit into the main text area.
  2. Enter the search string (or regex pattern) in the "Find" field.
  3. Enter the replacement string in the "Replace" field (use $1, $2 etc. for captured groups in regex mode).
  4. Toggle "Case sensitive", "Whole word" and "Use regex" options as needed.
  5. All matches are highlighted in the text area; the match count is shown above.
  6. Click "Replace All" to apply all replacements, or use "Replace Next" to step through them one at a time.

Your data never leaves your device — 100% private processing.

Regex replace patterns and back-references

When using regex mode, the replacement string can reference captured groups from the search pattern. A capture group is a portion of the pattern wrapped in parentheses. In most replacement engines (JavaScript, Python re.sub, sed), $1 or \1 inserts the text matched by the first capture group, $2 the second, and so on. Named groups (?<year>\d{4}) can be referenced as $<year>. For example, the pattern (\w+)\s(\w+) with replacement $2 $1 swaps two space-separated words. The special replacement $& inserts the entire matched string, useful for wrapping matches in markup.

Common bulk-editing use cases

Find & Replace is most powerful for repetitive transformations across large texts. Common tasks include: updating a domain name across hundreds of URLs (find https://old-domain.com, replace with https://new-domain.com); reformatting dates from MM/DD/YYYY to YYYY-MM-DD using a capturing regex; stripping HTML tags from copied web content; converting Windows line endings (\r\n) to Unix line endings (\n); replacing smart/curly quotes with straight ASCII quotes in code or CSV files; and normalising phone number formats across a contact list.

Common find-and-replace patterns
TaskFind (regex)Replace
Swap date MM/DD/YYYY → YYYY-MM-DD(\d{2})/(\d{2})/(\d{4})$3-$1-$2
Strip HTML tags<[^>]+>
Collapse multiple spaces\s{2,}
Convert CRLF to LF\r\n\n
Remove blank lines^\s*$\n
Wrap numbers in brackets(\d+)[$1]

Glossary

Back-reference
A replacement token ($1, \1) that inserts the text matched by a capture group into the replacement string.
Whole word match
A search mode that only matches the pattern when it appears as a complete word, bounded by non-word characters.
Greedy match
A regex quantifier behaviour that matches as many characters as possible, which can cause unintended over-matching.
Non-greedy (lazy)
A regex quantifier (*?, +?) that matches as few characters as possible, useful in HTML tag patterns.
Global flag
The g regex flag that causes a pattern to match all occurrences rather than stopping at the first.

Related reading

Frequently Asked Questions

Free · No spam

Get weekly tool tips & updates

New tools, power-user tips, and productivity hacks — delivered free every Friday.

No spam, ever. Unsubscribe with one click.

Why use Find and Replace Text?

  • Instant results with no signup or account creation
  • Works offline once the page is loaded
  • Supports Unicode and multilingual text
  • Copy results to clipboard with a single click

Common use cases

  • Count words in an essay before submission
  • Sort a list of items alphabetically
  • Remove duplicate lines from CSV exports
  • Change the case of text copied from PDFs
  • Find and replace text across large documents

Related Text Tools

Explore all Text Tools.