ToolJutsu
All tools
Text Tools

Find and Replace

Find and replace text, with optional regex support.

Processed on your device. We never see your files.

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

  1. 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.
  2. Type the text or pattern to find in the Find field and the replacement in the Replace with field.
  3. 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.
  4. The replacement count and the Result area update automatically. If the pattern is invalid, an error notice explains the problem.
  5. 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?
No. The find-and-replace operation runs entirely inside your browser using JavaScript's built-in RegExp engine. Nothing you type — the source text, the find pattern, or the replacement — is uploaded, stored, or shared. Your browser's Network tab will show no outgoing requests while you use the tool.
What does 'whole word' matching do?
When whole-word mode is on, the tool only matches the search term when it appears as a complete word — surrounded by word boundaries rather than embedded inside a longer word. For example, searching for 'cat' in whole-word mode matches 'cat' and 'Cat' but not 'catch' or 'scat'. This is the \b boundary in regular expression syntax.
How do I use capture groups in the replacement?
When regex mode is on, you can refer to capture groups in the replacement field using $1, $2, and so on. For example, if your pattern is (\w+)\s(\w+), the replacement $2 $1 will swap the two captured words. Named groups ((?...)) are referenced as $ in the replacement.
What happens if I enter an invalid regex pattern?
The tool catches the error immediately and shows a friendly message explaining what went wrong. The original text is left untouched and no replacement is attempted. Fixing the pattern instantly clears the error and shows the correct results.
Does this replace all occurrences or just the first one?
All occurrences. The tool always performs a global replace, equivalent to using the 'g' flag in a regular expression. The replacement count shown below the controls tells you exactly how many substitutions were made.

Related tools