Find and replace text

Find and replace swaps every occurrence of a search string with a replacement, in your browser, in one pass. The search term is treated as literal text (regex metacharacters are escaped), so a.b only matches the three characters a dot b. Matching is case-insensitive by default; flip Match case on for exact-case matching. For pattern-based work see regex replace.

Input
Line 1:1 LF cloud_done Saved locally
Result Find and Replace
0 lines 0 chars

Literal find and replace, predictable every keystroke

Find and replace looks for the exact string you type in Find and substitutes the exact string in Replace for every occurrence. Special regex characters in the find term (., *, ?, (, [, etc.) are escaped before the match runs, so the search is literal. Matches can overlap line breaks if you paste a multi-line search term, and an empty replacement deletes every match.

By default the search ignores letter case. Toggle Match case on when you only want the case-exact occurrences, for example when API should match but api should not. The substitution is global on every run: every match in the input is replaced, not just the first.

Want grouped captures, alternations, or anchored line matching? Use regex replace. To attach text to the start or end of every line instead of replacing in the middle, see add prefix to each line and add suffix to each line.

How to use find and replace text

  1. 1Paste or type your text into the input panel on the left.
  2. 2Type the search string into the Find field in the action bar.
  3. 3Type the replacement string into the Replace field. Leave blank to delete every match.
  4. 4Toggle Match case, Whole word, or Regex as needed.
  5. 5Click Copy or Download in the output header to take the result with you.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Literal search, regex chars escaped

Every metacharacter in Find is escaped before the match runs (., *, +, ?, ^, $, {, }, (, ), |, [, ], \). So a search for 1.5 hits 1.5, not 125 or 1x5. For pattern matching use the regex tool.

Global replace on every run

The internal flag is always g (or gi when case-insensitive). Every match in the input is swapped, not just the first one. The transform fires on each keystroke in the input or in the option fields.

Case sensitivity is opt-in to exact, default is loose

Match case is off by default, so Hello, hello, and HELLO all match a search for hello. Turn it on to limit matches to the exact letter case you typed.

Empty replacement deletes the match

Leaving the Replace field blank substitutes every match with an empty string, so the matches are removed. Combined with a non-empty find term this is a single-shot deletion.

Runs entirely in your browser

The match-and-replace step is a single JavaScript String.prototype.replace call against a generated RegExp. Nothing uploads. Nothing is logged on our side.

Worked example

Find Hello, replace with Hi, Match case on. The greeting changes, the unrelated API tokens stay, and foo is left alone because the search term is literal.

Input
Hello world. Hello team.
The API key is API_KEY.
foo foo foo
Output
Hi world. Hi team.
The API key is API_KEY.
foo foo foo

Settings reference

Behaviour Effect on output
Find (literal text) Searched as a fixed string. Regex metacharacters are escaped, so they only match themselves.
Replace (literal text) Substituted verbatim for every match. Empty value deletes the match.
Match case off Match is case-insensitive (gi flags). Hello and hello both match.
Match case on Match is case-sensitive (g flag). Only exact-case occurrences are replaced.
Whole word on Wraps the search in \b word boundaries. cat matches the standalone word but skips catfish and concatenate.
Regex on Find is treated as a JavaScript regex pattern. Use $1, $2 in Replace for capture groups (e.g. swap pairs with (\w+) (\w+) and $2 $1). Invalid patterns surface as [invalid pattern] in the output.
Empty Find Input passes through unchanged.
Whitespace and line endings Searched and replaced verbatim. LF stays LF, CRLF stays CRLF.
Non-ASCII text Matched at the code-unit level; accented and non-Latin characters work as long as the bytes match.

FAQ

Is this a regex search?
No. The search term is treated as literal text. If you need patterns, alternations, or capture groups, switch to regex replace.
How do I delete every occurrence of a string?
Type the string into Find and leave Replace empty. Every match is replaced with nothing, which removes it.
Why does hello match HELLO?
Match case is off by default. Turn it on in the action bar to restrict matches to the exact letter case in your search term.
Can I replace a line break?
Type the literal newline you want to match into Find by pressing Enter inside the field if your browser allows it. For more control over line endings, use regex replace with \n or \r\n.
Does anything get uploaded?
No. The replace runs in your browser via JavaScript. Your text never leaves the page.