Find and Replace Text

Find and replace text with regex support, case sensitivity, whole-word matching. Bulk edit large texts in browser.

What is Find and Replace?

Find and Replace searches for a specific text pattern in your document and replaces all occurrences with new text. The universal text-manipulation operation, available in every editor since Microsoft Word 1.0. This browser-based version handles unlimited text size, supports regular expressions (regex) for advanced pattern matching, case-sensitive matching, and whole-word-only matching. Useful for: bulk renaming (Mr. → Ms. across customer records), cleaning data (replace ‘,’ with ‘\t’ to convert CSV to TSV), formatting text (replace double spaces with single), URL updates (replace old domain in legacy content), removing unwanted text (replace ‘CONFIDENTIAL’ with empty), and complex pattern transformations using regex.

How to use this tool

  1. Paste your text — Any text — documents, code, CSV data, anything.
  2. Enter find pattern — Plain text or regex (if regex mode enabled).
  3. Enter replacement — What to replace each match with. Leave blank to remove matches.
  4. Set options — Case sensitive, whole words only, or regex mode.
  5. Click Replace All — All matches replaced. See count of replacements made.

Replacement modes

Plain text mode (default):

Find pattern treated literally — special regex characters escaped. ‘a.b’ matches only literally ‘a.b’.

Case sensitive:

‘Fox’ matches only ‘Fox’, not ‘fox’ or ‘FOX’. Default: case-insensitive.

Whole words only:

Adds word boundaries (\b in regex) around pattern. ‘cat’ matches ‘cat’ but not ‘category’ or ‘scatter’.

Regex mode:

Full JavaScript regex syntax. Pattern treated as regular expression.

\d+         → match any sequence of digits
[a-zA-Z]+   → match any word (letters only)
^Hello      → match 'Hello' only at line start
Hello$      → match 'Hello' only at line end
\s+         → match any whitespace
\b\w+\b     → match any whole word

Examples

  • Bulk salutation update: ‘Dear Mr.’ → ‘Hello, ‘ across 1000 emails
  • CSV to TSV: Replace ‘,’ with ‘\t’ (tab character)
  • Double space cleanup: Replace ‘ ‘ (2 spaces) with ‘ ‘ (1 space)
  • Domain migration: Replace ‘oldsite.com’ with ‘newsite.com’ across all links
  • Remove sensitive markers: Replace ‘CONFIDENTIAL’ with empty — clean docs for sharing
  • Regex digit extraction: Find ‘\d+’ replace with ‘#’ — censor all numbers
  • Phone format change: ‘(123) 456-7890’ → ‘+91 9876543210’ using regex pattern
  • Add prefix: Use regex ‘^’ (line start) replace with ‘- ‘ — bullet list every line

Tips & best practices

  • Test pattern on small sample first — some replacements are irreversible
  • Save original text before bulk replace — just in case
  • Use case-sensitive when matching exact strings (codes, IDs, names)
  • Whole-word matching prevents accidents: ‘cat’ won’t replace inside ‘category’
  • Regex is powerful but tricky — test with our Regex Tester first
  • To remove text, leave replacement field empty
  • For multi-step replacements, run multiple times with different patterns
  • Common regex shortcuts: \d (digit), \w (word char), \s (whitespace), . (any char)

Limitations & notes

JavaScript regex doesn’t support all PCRE features (lookbehind in older browsers). Very complex regex can be slow on large texts. No way to undo — always save originals. Special characters in plain text mode are escaped — need regex mode for advanced patterns. Doesn’t support multi-line patterns by default in regex mode (no /s flag).

Frequently Asked Questions

What’s the difference between plain text and regex mode?

Plain text: ‘a.b’ matches only ‘a.b’ literally. Regex mode: ‘a.b’ uses ‘.’ as ‘any character’ wildcard — matches ‘aab’, ‘a1b’, ‘a-b’, etc.

How do I replace special characters like newline?

Enable regex mode. Use \n for newline, \t for tab, \r for carriage return. In replacement field too: ‘\n’ inserts newline.

Can I find text on multiple lines?

Default regex doesn’t match across newlines (. excludes \n). For multi-line patterns, use [\s\S] which matches anything including newlines. Tool’s regex mode supports this.

How do I preserve capture groups?

In regex mode, use parentheses to capture: ‘(\w+)’ captures a word. In replacement, use $1, $2 to reference: replace ‘(\w+) (\w+)’ with ‘$2 $1’ to swap words.

Why doesn’t whole-word match work for my pattern?

Whole-word adds \b boundaries which only work at letter-to-non-letter transitions. ‘C++’ matched as whole word fails because + isn’t a word character. Use regex mode for custom boundaries.

Is there an undo button?

No — replacement is final. Recommended workflow: copy original to backup, then use Find and Replace. If wrong, restore from backup.

How fast does it work?

Instant for typical texts. Large texts (100MB+) may take a few seconds. Complex regex with backreferences can be slower than simple patterns.

Related tools

Regex Tester · Remove Duplicate Lines · Remove Line Breaks

Copied