Replace text online
Replace any word, phrase, or pattern in your text. Paste your content into the input, type what you want to find, and what to replace it with. The output updates instantly and shows a match count. Supports plain text and regular expression modes. All processing runs locally in your browser.
Input text
Result
FIND & REPLACE
How it works
In plain mode, the search text is escaped and matched literally using a JavaScript RegExp with the global and Unicode (u) flags. In regex mode, the pattern is used as-is, with the u flag when the pattern is valid with it. The case-insensitive flag is added unless Case sensitive is enabled. The whole-word option skips a match that has a letter, digit or underscore, in any script, directly before or after it. For a pattern that runs without the u flag, only A to Z, a to z, 0 to 9 and _ count as word characters. String.replace() with the RegExp applies the substitution across the entire input on every keystroke. In regex mode that work runs in a background Web Worker and is stopped after 2 seconds. All processing runs in JavaScript in your browser.
Processing runs in your browser
All processing happens locally in your browser tab. Our servers are not involved at any point.
Related operations
For more advanced pattern matching, try the regex tester. To alphabetise or dedupe the result, use sort lines. For comparing two versions of the text side by side, see text diff.
Frequently asked questions
- Can I replace across multiple lines?
- Yes. The input area accepts multi-line text and every line is searched. In regex mode, match a line break with \n. The tool sets only the g, i and u flags, so . does not match a line break and ^ and $ match only the start and end of the whole text; use [\s\S] to match any character including a line break.
- Can I use this to clean up pasted text?
- Yes. Common uses include removing extra spaces (find ' ', replace ' '), stripping unwanted characters, normalising line endings, or replacing placeholder text. The match count tells you how many replacements were made.
- What happens if my regex has an error?
- If your regex pattern is invalid, the tool shows an error badge next to the find field and no replacements are made. Fix the pattern and the output updates immediately.
- Can I delete every match instead of replacing it?
- Yes. Leave Replace with empty and every match is removed from the result. The match count shows how many were removed.
Last reviewed September 30, 2026
Other pages for this tool
Related tools
- Background reading: Complete guide to text tools
- Step by step: Extract and clean up text from a PDF