Find and replace
Find and replace is a text tool that substitutes any term inside a block of text. It supports plain or regular-expression search, case-sensitive and whole-word matching, and shows a live match count as you type. The tool runs in your browser.
Input text
Result
FIND & REPLACE
Dedicated pages
Mode-specific and use-case find and replace tools.
Find and replace whole words
Find and replace text in any document online. Supports plain search, case-sensitive, whole-word, and regex. Free, runs in your browser.
Regex find and replace
Find and replace text using regular expressions. Live match count, case-sensitive and whole-word options. Free, runs in your browser.
Replace text online
Replace words or phrases in any text online. Supports plain search and regex. See match count and instant results. Free, in-browser.
How to find and replace text
- Paste your text into the input area.
- Enter the text to find in the Find field.
- Enter the replacement text in the Replace with field.
- The result updates instantly. Enable Regex, Case sensitive, or Whole word options as needed.
Common uses
- Bulk editing repeated words or phrases in copied text before pasting elsewhere
- Using regex patterns to clean up log files, replace variable names, or reformat dates
- Working alongside a side-by-side comparison view to verify changes, or sorting and deduplicating the result afterward
Technical specification
- Algorithm or formula: Builds a JavaScript
RegExpfrom the find term with the global and Unicode (u) flags. Plain mode escapes regex metacharacters; a regex that is only valid withouturuns without it. Whole-word mode skips a match that has a letter, digit or underscore (in any script) directly before or after it; for a regex that runs withoutu, only A to Z, a to z, 0 to 9 and _ count as word characters. Replacement usesString.prototype.replace. - Browser API or library: Native JavaScript
RegExpand string methods, and a Web Worker for regex mode. No external library. - Input limits: Regex mode updates live for input up to 200,000 characters, and each run is stopped after 2 seconds. Plain mode has no fixed limit. Match count is computed via
matchAll. - Output: Replaced text plus a numeric match count. Invalid regex patterns surface the engine's error message.
- Known limitations: Regex mode runs in a separate Web Worker, so a pattern with catastrophic backtracking is stopped after 2 seconds with a message instead of freezing the tab. Multi-file replacement is out of scope.
Frequently asked questions
- Can I use regular expressions to find and replace?
- Yes. Enable Regex mode and the find field accepts a full JavaScript regular expression pattern. Capture groups from your pattern can be referenced in the replacement field using $1, $2, etc.
- Does the search distinguish uppercase and lowercase?
- By default the search is case-insensitive. Enable the Case sensitive toggle to match exact case. This applies in both plain and regex modes.
- How is the match count calculated?
- The match count shows the total number of occurrences of the find pattern in the input text. It updates live as you type in either the find field or the input area.
- Is my text sent to a server?
- All text processing runs locally in your browser using JavaScript. No text or data is sent to our servers.
Related tools
Regex tester
Test regular expressions with a live match list, replace, and split modes. Runs in your browser.
Sort lines
Sort lines alphabetically, by length, or shuffle randomly. Remove duplicates and empty lines in one click.
Text diff
Compare two texts in word, side-by-side, or git-style views. The word and side-by-side views highlight changed words.
Extract text from PDF
Extract plain text from a PDF using pdfjs-dist. Copy or download. Runs in your browser.
- Background reading: Complete guide to text tools
- Step by step: Extract and clean up text from a PDF
Reviewed and tested September 30, 2026.