Find and Replace
Search a block of text and replace every occurrence, as plain text or with a regular expression and capture groups.
Processed locally in your browser/ Your data stays in your browser.
What is Find and Replace?
Find and Replace swaps every occurrence of a word, phrase or pattern in your text. In plain mode the search is literal, with options for matching case and whole words only, so "cat" does not change "concat". The replacement is inserted exactly as typed.
Regex mode accepts JavaScript regular expressions: capture groups can be reused in the replacement as $1, $2 or $<name>, and \n and \t become a line break and a tab. ^ and $ match at every line. Regex mode runs in a background worker with a time limit, patterns are limited to 500 characters, and patterns prone to catastrophic backtracking are refused. The number of replacements is reported.
How does it work?
- Paste your text, then type what to find and what to replace it with.
- Choose match case and whole words, or tick regular expression to use patterns and groups such as (\d+)-(\d+) → $2-$1.
- Read the replacement count in the notes and copy the result.
Common use cases
- Renaming a variable, product name or URL across a pasted document.
- Reformatting dates from 2024-01-15 to 15/01/2024 with regex groups.
- Turning a comma-separated line into one item per line by replacing "," with \n.
- Removing unwanted words or characters from a text in one pass.
Examples
Try this input in the tool above:
2024-01-15, 2024-02-20, 2024-03-05
Privacy
Find and Replace runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Regex syntax is JavaScript’s (no lookbehind on very old browsers, no PCRE-only features). For advanced tests use the Regex Tester first.
Frequently asked questions
How do I reuse part of the match?
Enable regular expression, wrap the part in parentheses and write $1 (or $<name> for named groups) in the replacement.
Why was my regex refused?
It is longer than 500 characters, invalid, or has nested repetition such as (a+)+ that could freeze your browser. Simplify the pattern.
How do I insert a line break?
Type \n in the replacement (the "read \n and \t" option is on by default).
Related tools
Regex Replace
Rewrite text with a regex pattern and a replacement template that can reuse the captured pieces.
Developer Tools
Regex Tester
Write a pattern, paste some text and see every match highlighted, with its position and capture groups.
Developer Tools
Remove Extra Spaces
Clean up spacing in pasted text: double spaces, stray tabs, trailing spaces and runs of blank lines.
Text Tools
Case Converter
One tool for every text case: pick a style from the list and the text is converted instantly.
Text Tools
Add Prefix / Suffix to Lines
Put the same text at the start and end of each line, or number the lines automatically.
Text Tools
Text Cleaner
Sanitize text copied from the web, documents or AI chats: invisible characters, curly quotes, odd spaces and Unicode quirks, each step under your control.
Text Tools
Text Diff – Compare Two Texts
Paste an original and a modified text to see exactly what was added and removed, at the level of detail you choose.
Text Tools