How to find and replace text without losing context
Changing a repeated label is easy; deciding which occurrences should change needs care. Follow a small example and inspect the result before replacing your original.
In this guide
Keep a source copy and choose one change
Save an untouched copy before starting. Put the text you want to change in the source field and write the exact phrase you want to find in the search field. Our tool processes plain text already pasted into the page; it does not open documents, rename files or update your website. Name the saved result so you can tell it apart from the source when you return to it later.
Begin with one replacement rule that you can explain in a sentence. For example, replace the uppercase project marker OLD with new. Avoid combining unrelated edits in your first attempt. A narrowly defined change makes the match count easier to interpret and lets you inspect a few representative occurrences before applying another operation. A copy of the original also matters when the replacement already appears elsewhere and reversing the rule would change those earlier occurrences.
Work through four lines before using a large document
Paste the four lines below, enter OLD as the search text and new as the replacement, and leave Match case enabled. The result has Plan new on the first line, Plan old on the second, folder.new on the third and Keep Gnew on the fourth. The match count is three. The lowercase old remains unchanged because its letter case differs from the search phrase.
The last line is a deliberate warning about scope. OLD is also a substring at the end of GOLD, so it changes there too. The count of three is correct even though the last change may be unwanted. A count checks how many matches were processed; it cannot tell you whether those matches express your intention. Read every affected context in a small sample before using the same rule on a larger passage.
Plan OLD
Plan old
folder.OLD
Keep GOLDDistinguish substrings from complete words
This version replaces matching fragments wherever they occur. It does not offer a whole-word switch or understand the difference between a product label and a piece of another word. Searching for cat can change scatter as well as a standalone cat. Searching for a domain can change text inside a longer address. Choose the complete phrase when context matters, or use an editor with explicit whole-word or structured-field rules.
Spaces in the search are meaningful and can narrow a match, but adding spaces is not a universal word-boundary rule. A word at the start of a line, before punctuation or next to a tab may have different surrounding characters. If records come from a spreadsheet, export only the intended column rather than replacing across a whole CSV file. Plain-text matching does not parse quoted fields, HTML attributes or document formatting.
Use case matching deliberately
With Match case disabled, the worked example processes five matches. Plan old becomes Plan new, and folder.OLD becomes fnewer.new because folder also contains old. This option changes comparison, while the replacement field still supplies the exact characters to insert: it does not preserve the capitalization pattern of each occurrence. If you enter NEW, both OLD and old become NEW. For a presentation change across an entire passage, the separate case converter may be more appropriate.
Case-insensitive mode uses JavaScript Unicode simple case folding, independent of the English, Spanish or German page language. It does not remove accents, normalize Unicode or treat every linguistic spelling as equivalent. German ß is not interchangeable with ss under these rules. If a visually similar occurrence does not match, inspect its actual characters instead of broadening the rule without review. Identifiers whose case has meaning are better handled with Match case enabled.
Delete fragments and understand literal symbols
Leave Replace with empty to delete every match. A source such as red blue red, with red as the search, produces a space before blue and a space after it. Deletion removes only the matched characters; it does not automatically trim surrounding whitespace, remove duplicate rows or repair punctuation. Inspect the boundaries around removed phrases, especially when several fields or labels have been copied together into a single passage.
An empty search is rejected. A search consisting of spaces or actual line breaks is valid, because those are characters too. The text backslash followed by n is not converted into a newline instruction. Dots, stars and brackets are literal search text; dollar expressions such as $1 or $& are literal replacement text. There is no regex mode or capture-group template to enable. If you need a newline, paste or type an actual newline into the field.
Understand one pass and the match count
Every non-overlapping match is found in the original source from left to right. Inserted text is not searched again during that run. Replacing a with aa in aa therefore yields aaaa with two matches, not an endless expansion. Replacing aba with X in ababa yields Xba with one match because the second possible occurrence overlaps characters already consumed. These examples help distinguish a single replacement pass from repeatedly running a rule.
The match count includes substitutions that insert identical text. Finding cat and replacing it with cat in cat cat reports two processed matches, while the visible output stays the same. With no matches, the tool returns an unchanged result and a zero count. Neither case is a failure. Compare the output to your goal rather than assuming that a positive number means words changed, rows were removed or a document was successfully corrected.
Check duplicates created by rewriting
A replacement can make previously different lines identical. Suppose one list contains Plan OLD and Plan new. Replacing OLD with new leaves two copies of Plan new. The replacement tool keeps both, because its job is rewriting, not deduplication. If you need unique records, run the duplicate remover as a separate step and choose comparison rules there. Keep the pre-replacement list so you can trace which original entries were merged.
The list comparator can then show shared and exclusive entries against another list, and the word counter can help inspect quantities in the current text. Those checks serve different purposes: changed membership, repeated entries and character totals are not interchangeable evidence. Compare lists only when one complete line represents an item. A formatted paragraph or a record spanning several lines needs a different review method before you treat line groups as data.
Review and export the local result
Source accepts up to 500,000 UTF-16 units, search text 10,000 and replacement text 100,000. Generated output may contain at most 1,000,000 units. Expansion beyond the limit is rejected without a partial result or silent truncation. Shorten the source or replacement and rerun. These limits count internal text units, so an emoji may occupy more than one; they are not file-size limits expressed in bytes.
Processing remains in the current tab without a processing upload or stored text history. Edits to any field or the case option clear the old result and copy feedback. Review the output before copying or downloading replaced-text.txt. TXT uses UTF-8 and adds no final newline; browser textareas may already normalize pasted line endings. Save before clearing or leaving the page. Keep both source and result if the next person needs to check exactly what changed.
Frequently asked questions
Can I use this to edit a website automatically?
No. It transforms pasted plain text. Copy the reviewed result into the intended document or application yourself.
Can I reverse a replacement to undo it?
Not reliably. The replacement may already have existed in the source or multiple spellings may become identical. Return to the saved original.
Does a higher match count mean a better result?
No. It counts processed occurrences, including identical substitutions. Inspect the surrounding text and confirm the intended scope.