Text

Find & Replace

Find and replace text with regex support

Loading interactive tool…

Embed this tool on your site

About this tool

Find & Replace swaps words, phrases or patterns across a block of text. Paste your text, type what to find and what to replace it with, and click Replace text. Plain mode matches your search literally, with special characters escaped for you; tick Use regular expression to search with JavaScript regex syntax such as character classes, quantifiers, alternation and lookarounds. Ignore case matches every capitalization, and Replace all occurrences (on by default) can be unticked to change only the first match. Leave the replacement empty to delete matches. A status line reports how many replacements were made, or shows the error if a pattern is invalid. The replacement is inserted literally: $1-style capture references are not expanded, so captured text cannot be rearranged. There is no whole-word option, and ^ and $ match only the start and end of the whole text. Everything runs in your browser.

Why use it

  • JavaScript Regex Patterns: Use character classes, quantifiers, alternation and lookaheads to match patterns, not just fixed text.

  • Case-Sensitive or Insensitive: Matching is case-sensitive by default; tick Ignore case to match 'Error', 'error' and 'ERROR' in one pass.

  • First or All Matches: Replace every occurrence, or untick Replace all occurrences to change only the first one.

  • 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

  1. Paste your source text into the Original text box.
  2. Type the word, phrase or pattern you want to find in the Find field.
  3. Type your replacement in the Replace with field, or leave it blank to delete matches.
  4. Tick Use regular expression if your pattern uses regex syntax.
  5. Tick Ignore case to match any capitalization; untick Replace all occurrences to change only the first match.
  6. Click Replace text — the result and the replacement count appear on the right; click Copy result to copy it.

When it helps

  • When fixing a repeated typo or an outdated product name throughout a long document.
  • 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 deleting tracking parameters or another repeated pattern from a list of URLs.
  • When converting a tab-separated list to comma-separated by finding \t in regex mode and replacing it with a comma.

Examples

Normalize spelling variants

Input

The color of the colour chart

Expected result

Regex: colou?r → hue Result: 'The hue of the hue chart' (2 replacements)

Delete all numbers

Input

Order #12345 placed on 6th, ref 987

Expected result

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

Ignore case

Input

Error: disk full. ERROR: retry. error logged.

Expected result

Find: error (Ignore case) → warning Result: 'warning: disk full. warning: retry. warning logged.' (3 replacements)

Tips

  • Use the Ignore case checkbox to match all capitalizations; a leading (?i) inline flag is not valid JavaScript regex and shows an error.
  • In regex mode, wrap a word in \b anchors (\bcat\b) to avoid changing longer words like 'category'.
  • Use a character class such as [“”] in regex mode to replace both curly double quotes with a straight quote in one pass.
  • In regex mode, escape literal special characters with a backslash — e.g., use \. to match a period. Plain mode escapes them for you.
  • 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 like $1 in the replacement?
No. The replacement text is inserted exactly as typed, so $1, $2, $<name> and $& appear literally in the output. Capture groups still work for matching, for example \1 inside the pattern itself, but captured text cannot be rearranged in the replacement.
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?
By default it replaces every occurrence: Replace all occurrences is ticked, which applies the global (g) flag. Untick it to replace only the first match.
Is there a whole-word option?
No. In plain mode, 'use' also matches inside 'cause' and 'useful'. Tick Use regular expression and wrap the word in \b anchors, for example \buse\b, to match whole words only.
Do ^ and $ match at the start and end of each line?
No. Patterns run without the multiline flag, so ^ and $ match only the very start and end of the whole text. In regex mode you can match line breaks directly with \n.
What happens if my regex is invalid?
The status line shows "Invalid regex" with the browser's error message and no replacement is made. Fix the pattern and click Replace text again.
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.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities