What this tool does
A text replacer finds a string in your text and swaps every occurrence for something else. That part is table stakes. This one also stacks multiple find/replace rules in a single pass, counts matches live as you type, and highlights exactly what will change before you copy anything. If you have ever run the same text through a basic replacer three times in a row to fill three placeholders, the rule stack is for you.
Need to find and replace text directly on a live web page? Use the Text Replacer for Chrome extension instead.
What makes this replacer different
- Stackable rules. Add as many find/replace pairs as you need. They run top to bottom in one pass. Most competing tools give you one field and make you re-run the output through the tool for each additional change.
- Live match counts per rule. Each rule shows how many matches it found before you commit. A rule showing "0 matches" tells you about a typo in the Find field immediately, not after you have pasted the "result" somewhere.
- Color-coded match preview. Matches light up in your input text, one color per rule, so you can see what is about to change and catch accidental hits like "cat" inside "category".
- Regex without a separate tool. Regular expressions, capture groups, and whole-word matching are toggles on each rule, not a different page.
- Correct dollar-sign handling. In literal mode, replacing text with
$5inserts$5. A surprising number of online replacers pass the replacement straight to JavaScript's replace() and silently mangle it. - Private by design. Everything runs in your browser. Nothing is uploaded.
How to use it
- Paste your text into the input box.
- Fill in a rule: what to find, what to replace it with. Leave Replace empty to delete matches.
- Toggle options per rule if needed:
Aafor case-sensitive,.*for regex,|w|for whole words only. - Check the match counts and preview. Every rule shows its match count, and the preview highlights each match in your input.
- Add more rules if one pass isn't enough. Rules apply in order, top to bottom.
- Copy or download the result.
Copy-paste recipes
These are the replacements I actually reach for. Each one is a single rule unless noted. Patterns marked regex need the .* toggle on.
| Task | Find | Replace with | Mode |
|---|---|---|---|
| Remove all URLs | https?:\/\/\S+ | (empty) | regex |
| Strip trailing spaces from every line | +$ | (empty) | regex |
| Delete empty lines | \n{2,} | \n | regex |
| Collapse multiple spaces into one | {2,} | (one space) | regex |
| Straighten curly double quotes | [“”] | " | regex |
| Straighten curly apostrophes | [‘’] | ' | regex |
| Swap US dates for ISO (04/07/2026 to 2026-07-04) | (\d{2})/(\d{2})/(\d{4}) | $3-$2-$1 | regex |
| CSV commas to semicolons | , | ; | literal |
| Tabs to commas (TSV to CSV) | \t | , | regex |
| Wrap every line in quotes | ^(.+)$ | "$1" | regex |
| Add a prefix to every line | ^ | > | regex |
| Remove Markdown bold markers | \*\* | (empty) | regex |
The date-swap recipe is the one I show people who think they don't need regex. Three capture groups, one rule, and a whole spreadsheet column of dates changes format at once.
Regex quick reference
Enough regex to cover 90% of replacement jobs:
| Pattern | Matches |
|---|---|
\d | any digit (\d+ for one or more) |
\w | letter, digit, or underscore |
\s | any whitespace, including tabs and newlines |
. | any single character except newline |
[abc] | one character from the set |
[^abc] | one character not in the set |
^ and $ | start and end of each line (this tool always uses multiline mode) |
\b | word boundary, or use the ` |
a{2,4} | between two and four as |
| `(one | two)` |
\. \( \$ | a literal dot, parenthesis, or dollar sign |
In the replacement field: $1, $2 insert capture groups, $& inserts the entire match, and $$ gives a literal dollar sign (regex mode only; literal mode needs no escaping).
Gotchas worth knowing
Partial matches. Searching for cat changes category too. This is the single most common find-and-replace accident. Use the whole-word toggle, and glance at the preview highlights before copying.
Rule order matters. Rules run sequentially, so rule 2 operates on the output of rule 1. Replace cat with dog and then dog with ferret, and your cats become ferrets. Chains like this are handy when intentional and baffling when not, which is exactly why each rule shows its own match count.
Case sensitivity is off by default. Searching red also matches Red unless you turn on the Aa toggle. For prose edits the default is usually what you want; for code and IDs, turn it on.
Greedy quantifiers eat too much. In regex mode, ".*" across "a" and "b" matches the whole span from the first quote to the last. Use the lazy form ".*?" to match each quoted section separately.
Zero-match rules are usually typos. Invisible characters cause most "why won't it match" moments: a non-breaking space instead of a normal one, a curly quote instead of straight. The straighten-quotes recipes above fix the usual suspects. For deeper cleanup, run the text through the text cleaner first.
Troubleshooting
"Invalid pattern" on a rule? The exact error from the regex engine shows under the rule, and that rule is skipped while the rest keep running. The usual causes: an unclosed parenthesis or bracket, or a stray \ at the end. If you didn't mean to write regex at all, switch the rule back to literal mode.
Replacement produced fewer changes than the match count suggested? Check whether an earlier rule already rewrote some of that text. Counts are per rule, in order.
Need to replace across line breaks? . doesn't cross newlines. Use [\s\S] in place of . when the match should span lines, or remove the line breaks first with the line break remover.
Pasted from Word or Google Docs and matches are weird? Office apps insert smart quotes and non-breaking spaces that look identical to their plain cousins. Straighten quotes with the recipes above or convert everything with the plain text converter.
Related tools
- Duplicate Line Remover - clean repeated lines after a batch replace
- Whitespace Remover - normalize spaces, tabs, and blank lines
- Remove Line Breaks - flatten text before pattern matching across lines
- Text Cleaner - fix hidden characters that stop matches from landing
- Plain Text Converter - strip formatting from Word or Docs pastes
- Character Remover - delete specific characters without writing a rule
- Word Frequency Counter - see what's in the text before you change it
Privacy and security
All matching and replacing happens locally in your browser using the JavaScript regex engine. Your text never leaves your device, and the tool keeps working offline once loaded.