Text Tools
Find and Replace Text
Find and replace words in any text, with match case, whole-word and regular expression options, $1 group references and \n for line breaks.
How to use Find and Replace Text
Paste your text, type what to find and what to replace it with, and the result updates as you type. Leave Replace with empty to delete matches. The note shows how many replacements were made.
- Paste the textPaste the document, list, code or data you want to edit.
- Enter find and replaceType the word or pattern to find and its replacement; leave the replacement empty to delete.
- Refine the matchTick Match case, Whole words only or Regular expression, then copy the result.
How matching works, with an example
By default the search ignores case and matches inside words. In the sample, replacing world with there changes four places: hello world, Hello World, world peace and worldwide, which becomes therewide. Tick Whole words only and worldwide is left alone (3 replacements); tick Match case instead and Hello World is skipped. With Understand \n and \t ticked, you can replace a comma and space with \n to put each item of a list on its own line, or find \n and replace it with a comma and space to join lines into one.
Using regular expressions
Tick Regular expression to search with JavaScript regex syntax. The ^ and $ anchors match at the start and end of each line, and the replacement can use $1, $2 and so on for captured groups (named groups work too) and $& for the whole match. For example, find ^(\w+), (\w+)$ and replace it with $2 $1 to turn Smith, John into John Smith on every line, or use gr[ae]y to match both grey and gray. If the pattern is invalid, an error explains the problem and the text is not changed.
Accuracy and data handling
Before copying the output, check names, punctuation and the intended meaning against the source text. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Is find and replace case-sensitive?
Not by default: world also matches World and WORLD. Tick Match case to replace only matches with exactly the same capitals.
How do I delete a word from text?
Type the word in Find and leave Replace with empty. Every match is removed; tick Whole words only so the word is not cut out of longer words.
Does it support regular expressions?
Yes. Tick Regular expression to use JavaScript regex, including character classes, anchors and groups, and refer to captured groups in the replacement with $1, $2 and so on.
How do I replace commas with line breaks?
Find a comma followed by a space and replace it with \n while Understand \n and \t is ticked. Each item moves onto its own line.
More Text Tools
Related toolsTurn HTML into tidy Markdown with tables, lists, links and code.
Align Markdown table columns and turn spreadsheet data into tables.
Find, dedupe and sort the email addresses hidden in any text.
Get a clean, deduplicated list of the links in any text, HTML or log
Pull phone numbers out of text and list them in E.164 or national format.
Swap Chinese and English punctuation without breaking URLs or numbers.