Text Tools
Find and Replace Text: Online Tool
Find and replace text online. Supports case-sensitive, whole-word, and regex modes. Paste any text and replace all occurrences instantly.
3 matches found
Find and Replace
Paste or type your text, enter a search term, and instantly replace all occurrences. Three modes are available: plain (default), case-sensitive, whole-word, and regular expression.
Options
- Case sensitive: treats uppercase and lowercase as distinct.
- Whole word: only matches the exact word, not substrings.
- Regex mode: the find field is treated as a JavaScript regular expression.
Capture groups work in the replacement (e.g.,
$1).
Regex mode guide
In regex mode, capture groups let you rearrange and transform text. Use parentheses to capture parts of the match and reference them in the replacement string:
-
Find: (\d4)-(\d2)-(\d2)— captures a date in YYYY-MM-DD format Replace: $2/$3/$1— reformats it as MM/DD/YYYY
Common regex patterns
| Pattern | Matches | Example |
|---|---|---|
\d+ | One or more digits | 42, 1000 |
\s+ | One or more whitespace characters | spaces, tabs |
[A-Z] | Any uppercase letter | A, B, Z |
^line | "line" at the start of a line | line 1 |
\bword\b | Whole word boundary | "word" not "sword" |
(foo|bar) | Either "foo" or "bar" | foo, bar |
Use cases
- Bulk variable renaming: rename a variable throughout a code snippet without affecting partial matches.
- Date format normalization: convert between ISO dates, US dates, and European dates using capture groups.
- Whitespace cleanup: replace multiple spaces with a single space, or strip trailing spaces from each line.
- Markdown cleanup: remove or replace specific formatting patterns across a long document.
Privacy
All processing is done locally in your browser. Your text is never sent to a server.