Find and Replace Text Online
Paste your text, type what to find and what to put instead — the result appears live on the right, every change highlighted. Works with plain text or regular expressions, line breaks (\n) and tabs, and has an undo button. Nothing is uploaded.
What Is Find and Replace?
Find and replace is one of the most fundamental text-editing operations: you locate every occurrence of a search term and substitute it with new text. It is the workhorse behind tasks ranging from fixing a misspelled name throughout a document to reformatting structured data. A good find-and-replace tool does more than match literal strings — it can respect or ignore letter case, restrict matches to complete words so it does not break apart longer terms, and use pattern matching to handle variable text.
This tool brings those capabilities to the browser without any installation. You paste text into the input pane, type what you are looking for and what should go in its place, and the right-hand pane immediately shows the finished text with every replacement highlighted in green (a red bar marks spots where something was deleted). Because all matching runs on your own machine, even sensitive content such as code, logs, or personal notes can be processed safely.
How to Use This Find & Replace Tool
Paste or type your text into the Input Text pane. Enter the term you want to locate in the Find box and the substitution in Replace with — leave it empty to delete every match. The Result tab shows the text after replacing; the Matches tab shows the original with every match highlighted in yellow. The counter below tells you how many occurrences were found.
If the result is what you want, click Copy result — your input stays untouched. To work on the input itself, click Replace All (or press Ctrl+Enter in the Replace with box) to write the result back into the input, or Replace Next (Enter in the same box) to replace one occurrence at a time; the stats line tells you on which line it happened and how many are left. Undo takes back the last step, up to 30 steps.
Refine matching with the checkboxes: Case sensitive requires the exact letter casing, Whole word skips matches that are part of a longer word (it understands accented letters, so ber is not found inside über), and Regular expression treats the search as a JavaScript regex.
Replacing Line Breaks, Tabs and Commas
Line breaks cannot be typed into a one-line search box, which is why many people get stuck on tasks like “put every item on its own line”. Tick \n \t as line break / tab and write \n for a line break and \t for a tab, in the Find box and in Replace with. A literal backslash is \\. With the option off, a backslash is just a backslash.
The Quick buttons fill in the most common clean-up jobs for you, as ready-made regular expressions you can still edit:
- Line breaks → spaces joins all lines into one paragraph (Windows and Unix line endings).
- Commas → new lines turns
apples, pears,plumsinto a list with one item per line, dropping the spaces around each comma. - Multiple spaces → one collapses runs of spaces and tabs, for example in text copied from a PDF.
- Trailing spaces removes whitespace at the end of every line.
- Empty lines deletes blank lines, including lines that contain only spaces.
Plain Text vs. Regular Expressions
With Regular expression off, both boxes are plain text: characters such as ., *, ( and $ mean exactly themselves. Replacing USD with $$ really inserts two dollar signs — many online tools pass the replacement straight to JavaScript, where $$ silently becomes a single $ and $& repeats the match.
With the option on, the search is a JavaScript regular expression and the replacement understands $1, $2 … for capture groups, $<name> for named groups, $& for the whole match and $$ for a dollar sign. ^ and $ match at the start and end of every line, so ^ → - turns lines into a bulleted list. A pattern that would take too long — such as (a+)+$ on a long line — is stopped after 1.5 seconds with an explanation instead of freezing your browser tab. To build and debug a more complex pattern step by step, use the Regex Tester.
Real-World Use Cases
- Renaming a variable or function — turn on Whole word and Case sensitive to rename
userIdacross a code snippet without touchinguserIdList. - Cleaning up pasted data — strip out repeated separators, fix inconsistent spacing, or normalize line formatting in copied text.
- Reformatting with regex — use a capture-group pattern to reorder fields, such as swapping
First LastintoLast, First. - Updating boilerplate — replace a placeholder like
{{name}}with a real value throughout a template. - Redacting sensitive terms — locate and replace names, IDs, or tokens with a masked value entirely offline.
Tips for Effective Find and Replace
- Watch the live highlighting and match count before clicking Replace All so you can confirm the pattern hits exactly what you intend.
- Enable Whole word when replacing short terms to avoid accidentally matching them inside longer words.
- In regex mode, use capture groups in the Find box and reference them with
$1,$2in the Replace box to rearrange matched text. - If your search uses characters like
.,*, or(as literal text, leave regex mode off so they are matched exactly rather than as special symbols. - Use Replace Next to review and apply changes individually when you only want to fix some occurrences, not all of them.
Features
- Live result preview — the finished text appears as you type, replacements in green, deletions marked in red.
- Matches view and counter — see every match in the original and the exact number before changing anything.
- Case-sensitive and whole-word matching — whole words work with accented letters and with terms like
C++. - Line breaks and tabs —
\nand\tin both boxes, plus one-click presets for common clean-ups. - Regular expressions — capture groups
$1, named groups$<name>, line anchors; runaway patterns are stopped after 1.5 s. - Replace Next, Replace All, Undo — step through occurrences or change everything, and take it back.
- 100% client-side — your data never leaves your browser.
Frequently Asked Questions
Is my text stored anywhere?
No. All find and replace operations happen entirely in your browser using JavaScript. Your text is never uploaded, sent to a server, or stored anywhere outside your own device.
Can I use regex capture groups in the replacement?
Yes. When the Regular expression option is enabled, wrap parts of your pattern in parentheses to create capture groups, then reference them with $1, $2, and so on in the Replace with field to reuse the matched text.
How do I replace something with a new line?
Tick the \n \t option and type \n in Replace with. For example, Find , and Replace with \n puts every comma-separated item on its own line. To do the opposite and join lines, search for \n and replace it with a space — or use the Quick buttons.
What is the difference between Replace Next and Replace All?
Replace All writes the complete result into the input at once and reports how many occurrences were changed. Replace Next replaces a single occurrence, continues after it on the next click, and tells you the line number and how many are left — useful when you only want to change some of them. Both can be reversed with Undo.
Why does my replacement contain a single $ in other tools?
JavaScript’s replace() treats $$, $& and $1 in the replacement as special patterns. Tools that hand your text straight to it change dollar signs even when you are not using regular expressions. Here, plain-text mode inserts the replacement exactly as typed; the special patterns only apply when Regular expression is on.
What does the Whole word option do?
Whole word wraps your search in word boundaries so it only matches complete words. For example, searching cat with this option on will match cat but not the cat inside category or scatter.
What happens if my regular expression is invalid?
If the pattern cannot be compiled, the tool shows the browser’s error message (for example “Unterminated group”) and leaves your text unchanged, so a typo in a regex will never corrupt your input. A valid pattern that runs too long is stopped after 1.5 seconds, also without changing anything.
Is matching case sensitive by default?
No. By default the search ignores letter case, so Apple matches apple and APPLE. Enable the Case sensitive checkbox to require an exact case match.