Find and Replace
Find and replace text, with optional regex support.
How to use Find and Replace
What this tool does
The Find and Replace tool lets you search for any text — or a regular expression pattern — within a body of text and substitute every occurrence with a replacement string of your choice. Three toggles refine the search: case sensitive controls whether the capitalisation must match exactly; whole word limits matches to complete words at boundaries; and use regex switches from plain text matching to full JavaScript regular expression syntax.
The replacement count updates in real time as you type, so you can see at a glance how many substitutions will be made before you copy the result. Invalid regex patterns are caught and explained without crashing or corrupting the source text. The result textarea shows the final output with all replacements applied.
Why you might need it
The find-and-replace built into word processors and text editors is powerful, but it is tied to a specific application. When you are working with text across multiple tools — a snippet pasted from a database, a log file opened in a browser, a config exported from a web app — a standalone browser-based tool lets you clean and transform that text before it reaches its destination.
Regular expression mode extends the reach considerably. You can use it to normalise phone number formats, strip HTML tags, rewrite date formats from MM/DD/YYYY to YYYY-MM-DD, extract and restructure structured data, or remove every line that matches a pattern. None of that is possible with a simple literal search.
Marketers and writers use it for bulk token replacement: swapping a placeholder company name across a template, replacing one product name with another across a long document, or changing pronouns consistently. Developers use it to prepare data for import scripts or to prototype a transformation before encoding it in code.
How to use it
- Paste or type the text you want to work with into the Source text box. Use Load sample to try the tool with a ready-made example.
- Type the text or pattern to find in the Find field and the replacement in the Replace with field.
- Toggle Case sensitive, Whole word, and Use regex to match your needs. Descriptions appear as placeholder text in the fields when regex mode is active.
- The replacement count and the Result area update automatically. If the pattern is invalid, an error notice explains the problem.
- Use Copy result to put the output on your clipboard, then Clear to start fresh.
Common pitfalls
The most frequent mistake in regex mode is forgetting to escape characters that
have special meaning in patterns. A period . matches any character, not just a
literal dot. A plus sign + is a quantifier. To match a literal dot, type \.;
to match a literal plus sign, type \+. When regex mode is off, the tool escapes
these characters automatically, so literal search always works as expected.
Case sensitivity surprises people when they first turn it off. By default the tool is case-insensitive, meaning “cat” matches “Cat”, “CAT”, and “cat”. Turning case sensitivity on limits matches to exactly the capitalisation you typed.
Whole-word matching relies on the \b word boundary, which is the transition
between a word character (\w, meaning letters, digits, and underscore) and a
non-word character. This means that searching for “US” in whole-word mode will
not match “CUSTOMER” because “US” is embedded within word characters — but it
will match “US dollar” because “US” is followed by a space.
Tips and advanced use
For date reformatting, a pattern like (\d{2})\/(\d{2})\/(\d{4}) with a
replacement of $3-$1-$2 converts every MM/DD/YYYY date in the text to
ISO 8601 format (YYYY-MM-DD). This is faster than writing a one-off script when
you need to clean a handful of records.
To delete every occurrence of a word or phrase rather than replacing it, leave the Replace with field empty. An empty replacement is valid and simply removes all matches.
To strip HTML tags from a pasted article, turn on regex mode and search for
<[^>]+> with an empty replacement. This matches every tag from <p> to
complex attributes and removes them, leaving only the text content.
The $& replacement token (available in regex mode) inserts the entire matched
string into the replacement, which lets you wrap matches without capturing them.
For example, searching for \b\d+\b and replacing with [$&] wraps every
standalone number in square brackets.
Because this tool runs entirely in your browser with no server communication, it is safe to use with sensitive source material such as internal documents, personally identifiable information, or unreleased content.
Frequently asked questions
Is my text sent anywhere when I use this tool?
What does 'whole word' matching do?
How do I use capture groups in the replacement?
What happens if I enter an invalid regex pattern?
Does this replace all occurrences or just the first one?
Related tools
Text Diff Checker
Compare two texts and highlight every difference.
Case Converter
Convert text to UPPERCASE, lowercase, Title Case, and more.
Remove Duplicate Lines
Delete duplicate lines from a list of text.
Whitespace Remover
Remove extra spaces, tabs, and blank lines from text.
Regex Tester
Test regular expressions with live match highlighting.
Sort Lines
Sort lines alphabetically, numerically, or by length.