Find and Replace

Find a phrase and replace every occurrence in your text. Plain match by default; toggle regex for advanced patterns. Browser-only โ€” your content never leaves your device.

Example: Hello world. Hello there. โ†’ Hi world. Hi there. (replace 'Hello' with 'Hi')

Find a phrase and replace every occurrence with another phrase, in a single pass. Default behaviour is plain-text match (the find string is escaped before matching) โ€” type literally what you want to replace.

Runs entirely in your browser. Your text isn't uploaded or logged. Useful for quick edits where opening a full editor is overkill.

When you reach for this

Updating brand names across a document

Company rebrand? Find old name, replace with new โ€” single click, every occurrence.

Replacing placeholder text

Paste a template with {{name}} placeholders, then run find-and-replace to fill them in.

Fixing systematic typos

Realised you spelled a recurring term wrong? Find-replace fixes them all in one go.

Switching between conventions

Convert "e.g." to "for example", or "&" to "and", or em dashes to en dashes โ€” anywhere a global tone change applies.

Stripping unwanted characters

Replace any character with empty string to remove every occurrence: emojis, special punctuation, line numbers from copied code.

What gets processed (and how)

The tool performs a single-pass find-and-replace operation using JavaScript's String.prototype.replace() with the global flag (g). In plain-text mode, the search string is first sanitized by escaping all regex-special characters (.^$*+?{}[]|()\) before constructing a RegExp โ€” this guarantees literal matching. In regex mode, the user-supplied pattern is used directly (no escaping) to build the RegExp, enabling advanced patterns like \d+ or backreferences ($1). The replacement string supports the same $-based substitutions as JavaScript's String.replace() (e.g., $&, $1). The operation is entirely client-side โ€” no data is sent to a server. The tool does not support case-insensitivity by default; users must explicitly toggle regex and use the i flag if needed.

How to use it

  1. Paste or type your target text into the input box.
  2. Enter the phrase or pattern you want to find in the 'Find' field.
  3. Enter the replacement text in the 'Replace' field.
  4. Click 'Replace All' (or use the toggle for regex, then click again).

Behavior on tricky inputs

Empty find string
If the find field is empty, JavaScript's replace with empty pattern matches the start of every position, effectively inserting the replacement before each character and at the end.
Overlapping matches
Because replacement happens in a single pass using a global regex, overlapping matches are not possible; each match is replaced and the cursor moves past the replacement.
Escaped characters in plain mode
In plain mode, backslash sequences like \n are treated literally, not as newline; use regex mode with the actual escape sequence to match them.

Workflow tips

  • In plain mode, always escape literal dots (e.g., '.' becomes '\.') if you want to match a dot literally โ€“ otherwise it matches any character.
  • Use regex mode with capturing groups to rearrange text, e.g., find '(\w+) (\w+)' replace with '$2 $1' swaps two words.
  • To replace newlines or tabs, switch to regex mode and use \n or \t in the find field; plain mode treats them as literal strings.
  • Test complex regex patterns in small batches first to avoid unintended replacements โ€“ the tool replaces all matches in one go.

vs other ways to do this

Several common ways to perform find-and-replace exist; here's how this tool compares.

This toolText Editor (Notepad++)sed command
Client-sideYes โ€“ browser only, no serverNo โ€“ desktop applicationNo โ€“ command-line utility
Regex supportYes (toggle on/off)Yes (with extended options)Yes (POSIX/ERE syntax)
Learning curveMinimal โ€“ just two input fieldsLow โ€“ intuitive GUIModerate โ€“ requires shell knowledge

Where this came from

The find-and-replace concept originated with computer text editors in the 1970s. Ken Thompson's ed (1971) introduced the s command for substitution, which later inspired sed (stream editor) in 1974. These tools established the pattern of using delimiters and regex for text replacement. Modern GUI editors and online tools like this one simplify the interface, making the functionality accessible without a command line.

Common questions

Is the search case-sensitive?

Yes โ€” "Apple" and "apple" are different. Lowercase your text first using the lowercase converter if you need case-insensitive matching.

Does it support regular expressions?

Not in this simple tool โ€” it does plain-text replace only. For regex matching, use a code editor or run a JS console regex.

Will it replace only whole words?

No โ€” substring match. "cat" replaces "cat" inside "category" too. To force whole-word matching, include leading and trailing spaces in your find string.

How many replacements are done?

All occurrences in one pass. The replacement is global by default.

Embed our tools on your website

Free for any site. No signup. Iframe loads from our servers and stays up-to-date automatically.

๐Ÿ“‹ Embed the Word Counter

Copy this snippet:

Live preview:

๐Ÿ“‹ Embed this Find and Replace

Copy this snippet:

Live preview:

Want more options? All embeddable tools โ†’