To find and replace text online, paste your text into Raw Input, type the word in Find and the new text in Replace with, then select Replace all. The edited text shows in Output Preview with a count of replacements made. Tick Case-sensitive, Whole word only or Regex mode for tighter matching.
How to find and replace text online
- Add your text. Paste into Raw Input, or select Select text file to load a .txt, .csv, .log, .md, .json, .xml, .html, .js or .css file.
- Search. Type in Find. Matches are found as you type and listed under Match Results with their line number and the words around them.
- Set the matching rules. Tick Case-sensitive to tell Hello from hello, Whole word only to skip partial matches, or Regex mode for patterns.
- Replace. Enter the new text in Replace with and select Replace all, or step through with Next match and Replace current.
- Save the result. Select Copy output or Download for a .txt file.
Replace words in text, one or all
Replace all changes every match in one go and adds the number to the Replacements Made counter. Replace current changes only the highlighted match, which is safer when the same word means different things in different places. Use Previous match and Next match to move through the list, or click any entry in Match Results to jump to it.
Each replacement works on the current output, so you can run several search and replace text passes in a row: replace colour with color, then organise with organize, and so on. Your original stays in Raw Input. If you edit Raw Input, the output resets to match it, so finish editing before you start replacing.
Case-sensitive and whole-word matching
By default the search ignores case, so apple also finds Apple and APPLE. Tick Case-sensitive to match exactly what you typed.
Whole word only stops partial matches. Without it, replacing cat with dog also turns category into dogegory. With it, only the separate word cat changes. Whole-word matching treats letters from any language, digits and underscores as parts of a word, so café and naïve are matched as whole words too.
Regex find and replace
Tick Regex mode to search with JavaScript regular expressions. The pattern is run with the global and Unicode flags (so \p{L} works), plus case-insensitive matching unless Case-sensitive is ticked. In Replace all and Replace current you can reuse captured groups with $1, $2 and $& (the whole match). Outside Regex mode the replacement is inserted exactly as typed, so a $ stays a $.
| Find | Replace with | Result |
|---|---|---|
(\d{4})-(\d{2})-(\d{2}) | $3/$2/$1 | 2026-10-11 becomes 11/10/2026 |
{2,} | a single space | Collapses runs of spaces |
\bcolou?r\b | shade | Replaces both color and colour |
(\w+)@example\.com | $1@example.org | Moves addresses to a new domain |
A few things behave differently from some code editors. Whole word only works in Regex mode too: the whole pattern has to start and end at a word boundary. The multiline flag isn't set, which means ^ and $ match the start and end of the whole text, not each line. An invalid pattern shows an error badge instead of results. To build and debug a tricky pattern first, try the regex tester.
Common uses for a text replace tool
- Renaming in a document. Swap a product or client name across a long contract or a set of notes before sending it.
- Cleaning exported data. Change semicolons to commas in a CSV, or strip a prefix from every line of a log file.
- Fixing spelling variants. Convert British to American spelling, or the other way round, one pair at a time.
- Joining broken lines. In Regex mode, find
\nand replace with a space. For more line and space cleanup in one step, use remove line breaks.
When you're done, the diff checker shows exactly what changed between your original and the edited version.
Frequently asked questions
How do I find and replace a word in text?
Paste your text, type the word in Find and the new word in Replace with, then select Replace all. Tick Whole word only if the word also appears inside longer words.
Can I use regular expressions?
Yes. Tick Regex mode to use JavaScript regex syntax. Replace all and Replace current support capture groups such as $1 and $2 in the replacement.
Is the search case-sensitive?
Not by default. The search matches upper and lower case alike until you tick Case-sensitive.
Can I undo a replacement?
There's no undo button, but your original text stays untouched in Raw Input. Editing Raw Input resets the output to match it, so you can start the replacements again.
Is my text uploaded?
No. Searching and replacing happen in your browser, and files you load are read on your device. Nothing is sent to ToolzyLab.
Are there keyboard shortcuts?
Yes. In Raw Input, Ctrl+Enter (Cmd+Enter on a Mac) runs Find matches. The tool also maps F3 and Shift+F3 to the next and previous match.