Find & Replace
Find and replace text with regex support
Drop a file (optional)Tap to choose a file (optional)
or click to browseor tap to choose
.txt, .json, .csv, .md, .html, .xml, or .docx — or just paste text below instead
Large files (over 50 MB) may take longer or run out of browser memory
About Find & Replace
Finds every occurrence of a specific word or phrase and replaces it with something else, all at once. Works with pasted text, or upload a file directly — .txt, .json, .csv, .md, .html, .xml, and .docx are all supported, and the result downloads back in the same format you uploaded.
Paste your text, or upload a file, then enter what you want to find and what to replace it with. For an uploaded file, download the corrected version afterward instead of copying from the box.
For a .docx file specifically, the replace happens inside the actual document so formatting is preserved — a phrase is found even when Word has split it across formatting changes; the replacement takes the formatting of where the match starts.
Watch: Find & Replace in Action
- What file types can I upload for find and replace?
- Pasted text works directly, and you can also upload .txt, .json, .csv, .md, .html, .xml, or .docx files — the result downloads back in the same format you uploaded.
- Why might a replacement be missing in my .docx file?
- For a .docx file, the replace happens inside the actual document so formatting is preserved — but if a search term happens to span a formatting change (part bold, part not, for example), it won't be found at that exact split point. This is a real limitation of editing a Word document this way, not specific to this tool.
- Is my Word formatting kept when I edit a .docx?
- Yes. The text inside the document's runs is edited in place, so fonts, images and layout stay. A phrase split across several formatted pieces is still found, and the replacement takes the formatting of the piece where the match begins.
- What does Preserve case do?
- It makes the replacement copy the style of each match: an all-capitals match gives an all-capitals replacement, a Capitalized match gives a replacement with a capital first letter, and an all-lowercase match uses your text as typed.
- How do I reuse part of the match in the replacement?
- Turn Regex on, put parentheses around the part in Find, and write a dollar sign plus the group number (one, two and so on) in Replace with. A dollar sign and ampersand insert the whole match, and a dollar sign with a name in angle brackets inserts a named group. In this mode \n and \t become a new line and a tab.
- Is the search case sensitive, and what counts as a whole word?
- Not by default; switch on Case sensitive to make it so. Whole word requires that the match is not touched by a letter, digit or underscore on either side, and it understands letters from any language, not just English.
- Which files can I upload, and what about old .doc files?
- .txt, .json, .csv, .md, .html, .xml and .docx. A .doc file is refused with advice to save it as .docx in Word first, and any other extension gets a message listing the supported types.
- Can I find and replace in a Word document?
- Yes. Drop the .docx file, set Find and Replace with, press Replace All and download the corrected file. The text is edited in place, so fonts, images and layout stay.
- Does find and replace support regex?
- Yes, JavaScript regex syntax with $1 style groups. Switch Regex on, put parentheses around the part you want to reuse and write $1 in Replace with.
- Are headers, footers and footnotes changed in a .docx?
- Not yet. Only the main body of the document is edited; headers, footers and footnotes are left as they are.
- Is my file uploaded when I use find and replace?
- No. Pasted text and files are processed in your browser and nothing is sent to a server.
How to use Find & Replace
Paste text into the box, or drop a .txt, .json, .csv, .md, .html, .xml or .docx file. Type the phrase in Find and its substitute in Replace with; a counter beside the switches shows how many matches exist before anything changes. Press Replace All to apply it, and Undo to step back one replace.
Four switches refine matching: Regex, Case sensitive, Whole word and Preserve case. With Regex on, a fifth, ^ $ match each line, appears. For an uploaded file, press Download Corrected File when you are satisfied; it is saved under the original name plus _edited. A .docx opens as a read-only text preview, and its download button appears after the replace has run.
When to use it
Useful for renaming a product throughout a long README, swapping an old company name in a contract draft, fixing a repeated typo in a CSV export, updating a domain in an HTML or XML file, or filling a placeholder such as {{name}} in a template. Regex mode handles patterns like reordering dates with captured groups.
When not to use it
Avoid it for edits that depend on meaning rather than spelling, such as changing a word only where it is a verb. Do not run it blind on JSON or XML: it warns if the result no longer parses, but it cannot tell whether the data still makes sense. For cell-level spreadsheet work use the spreadsheet's own find and replace, and for many code files use a code editor.
Tips for best results
Read the match counter before pressing Replace All. A count far higher than expected usually means you need Whole word, so cat does not also hit catalog. Preserve case turns Cat into Dog and CAT into DOG when you type dog as the replacement. In Regex mode a dollar sign followed by a group number inserts that captured group, a dollar sign and ampersand insert the whole match, and \n or \t give a line break or tab. Outside Regex mode your replacement is literal.
Limitations
In a .docx only the main body part is edited, so headers, footers and footnotes are left alone, and each paragraph is matched on its own, so a pattern cannot span a paragraph break. The older .doc format is refused. Undo goes back one replace only. Regex follows JavaScript syntax, and the live match counter is hidden for .docx files.
Privacy
Pasted text never leaves the page. An uploaded text file is read with your browser's file reader, and a .docx is opened as a zip archive in the browser, edited in its main document part and zipped again there. No text or file contents are transmitted. The corrected file is created on your device when you click the download button.
Next: Email Extractor
Pull out every email address
More from Text & Writing: