UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

Find & Replace

Find and replace text with regex support

About Find & Replace

Find & Replace is one of the most frequently needed text operations, yet most online versions are limited to simple literal string matching. This tool goes further by offering both plain-text and full regular expression (regex) matching modes, case-sensitive or case-insensitive matching, and whole-word matching — giving you the same power as a code editor's find-replace, accessible directly in your browser. Paste your text, enter your search pattern, provide the replacement string, and all matches are highlighted and replaced instantly. Regex mode unlocks pattern-based replacements: strip all numbers, normalize whitespace, reformat dates, or apply any transformation expressible as a regex. A match count shows you how many substitutions were made, so you can verify the operation completed as expected before copying the result.

Why use Find & Replace

Full Regex Pattern Support

Use capturing groups, character classes, quantifiers, and lookaheads — everything a code editor's find-replace supports.

Case-Sensitive & Insensitive Modes

Match 'Error', 'error', and 'ERROR' with a single pattern by toggling case sensitivity off.

Whole-Word Matching

Replace 'use' without accidentally modifying 'cause', 'useful', or 'misuse' by enabling whole-word mode.

Match Count Display

Shows how many substitutions were made so you can verify the operation before copying.

Delete Mode via Empty Replacement

Leave the replacement field empty to delete all matches — useful for stripping unwanted tokens or patterns.

Instant In-Browser Processing

Replacements run client-side with no upload or server round-trip, even for large text blocks.

How to use Find & Replace

  1. Paste your source text into the input area.
  2. Type the text or regex pattern you want to find in the Find field.
  3. Type your replacement string in the Replace field (leave blank to delete matches).
  4. Toggle Regex mode if your pattern uses regular expression syntax.
  5. Toggle Case Sensitive if capitalization matters in your search.
  6. Click Replace All — the output updates instantly and shows the match count.

When to use Find & Replace

  • When normalizing date formats across a data file, such as converting MM/DD/YYYY to YYYY-MM-DD.
  • When stripping all numbers or punctuation from a text block using a regex character class.
  • When renaming a variable or term across a large block of copied code or documentation.
  • When replacing smart curly quotes with straight ASCII quotes before pasting into code.
  • When extracting just the email addresses or URLs from a text by replacing non-matching text.
  • When converting a tab-separated list to a comma-separated one by replacing \t with ,.

Examples

Date format conversion

Input: Event on 03/15/2024, deadline 12/01/2024

Output: Regex: (\d{2})/(\d{2})/(\d{4}) → $3-$2-$1 Result: 'Event on 2024-15-03, deadline 2024-01-12'

Delete all numbers

Input: Order #12345 placed on 6th, ref 987

Output: Regex: \d+ → (empty) Result: 'Order # placed on th, ref '

Swap first and last name

Input: Smith, John Doe, Jane

Output: Regex: (\w+), (\w+) → $2 $1 Result: 'John Smith Jane Doe'

Tips

  • Use (?i) or toggle case-insensitive mode to match all capitalizations of a word in a single pass.
  • To delete blank lines, use the regex ^\s*$ with an empty replacement and enable multi-line mode.
  • Capture groups let you reformat data: (\d{2})/(\d{2})/(\d{4}) with replacement $3-$2-$1 converts MM/DD/YYYY to YYYY-MM-DD.
  • Escape literal special characters with a backslash when searching for them — e.g., use \. to match a period, not any character.
  • Test your pattern on a small excerpt first before applying it to a large document to catch unintended matches.

Frequently Asked Questions

What regex flavour does this tool use?
The tool uses JavaScript's built-in RegExp engine, which supports standard regex features: character classes, quantifiers, capturing groups, named groups, lookaheads, and lookbehinds. PCRE-specific features like \K are not supported.
Can I use backreferences in the replacement string?
Yes. Use $1, $2, etc. to reference capture groups in the replacement. For named groups, use $<name>. For example, the pattern (\w+)\s+(\w+) with replacement $2 $1 swaps two words.
What does leaving the replacement field empty do?
An empty replacement string deletes all matches. This is useful for stripping unwanted characters or patterns from your text.
Does it replace all occurrences or just the first?
Replace All replaces every occurrence in the text. This is equivalent to using the global flag (g) in JavaScript regex.
How does whole-word matching work?
Whole-word mode wraps your search term with \b word boundary anchors, so the pattern only matches when the search string is not surrounded by word characters on either side.
Can I use multi-line regex anchors like ^ and $?
Yes. Multi-line mode is enabled by default, so ^ matches the start of each line and $ matches the end of each line, not just the start and end of the entire input.
What happens if my regex is invalid?
The tool displays a regex error message and does not perform any replacement. Fix the pattern and the replacement will proceed once the regex is valid.
Is there a limit on input text size?
There is no enforced limit. Very large inputs with complex regex patterns may take a moment to process due to the JavaScript regex engine, but typical text sizes (under a megabyte) process instantly.

Explore the category

Glossary

Regular Expression (Regex)
A pattern-matching syntax that uses special characters to describe sets of strings. Used to find, extract, and transform text programmatically.
Capture Group
A portion of a regex pattern enclosed in parentheses that captures the matched text. Referenced in the replacement string as $1, $2, etc.
Word Boundary (\b)
A zero-width assertion in regex that matches the position between a word character and a non-word character. Used for whole-word matching.
Global Flag (g)
A regex modifier that causes the engine to find all matches in the input string rather than stopping after the first match.
Lookahead
A zero-width regex assertion that matches a position followed (or not followed) by a specific pattern, without consuming characters.
Backreference
A reference in the replacement string to a capture group matched by the regex pattern. Written as $1, $2, or $<name> in JavaScript.