Find and Replace Text
Use the CaseSwitch Find and Replace tool to swap a word or pattern across a paste in one pass. Enter find and replace text, optionally enable regex or case sensitivity, then copy the result. Processing stays in this browser — nothing is uploaded.
Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.
Last reviewed: 23 July 2026
Processed locally in your browser. Nothing is sent to a server.
Paste or type text to convert. Output stays empty until there is input.
Character count: 0 · Word count: 0 · Line count: 0
Examples
Find "foo", replace "baz" (defaults)
Input
foo bar foo
Output
baz bar baz
Find "foo", replace "baz" (caseSensitive false)
Input
Foo BAR foo
Output
baz BAR baz
Regex colou?r → hue (useRegex on)
Input
color colour color
Output
hue hue hue
Find "foo", replace "baz" (caseSensitive true)
Input
Foo BAR foo
Output
Foo BAR baz
Find "Draft", replace "Final" (caseSensitive false)
Input
DRAFT notes — draft ready
Output
Final notes — Final ready
How to use
- Paste the document into the input panel and fill Find and Replace with.
- Leave Case sensitive off for typical renames; turn it on when letter case must match exactly. Enable Use regular expression only when you need a pattern.
- Compare the right-hand output to the input, then copy when the replacements look right.
What this tool is for
Find and replace is bulk editing for plain text: rename a product in a README, swap British for American spelling, fix a repeated typo, or run a light regex cleanup on a log dump. This page is a browser-side editor, not an IDE refactor — it does not understand scope, syntax trees, or project files. Use it when the whole paste is the document you want to change.
How it works
The Find field is searched through the input; every match is replaced with the Replace-with string. Options: Use regular expression (default off) and Case sensitive (default off). With regex off and case sensitivity off (the defaults), matching is literal and case-insensitive — “foo” matches “Foo” and “FOO.” With Case sensitive on, only exact letter case matches. With Use regular expression on, the find field is compiled as a JavaScript RegExp with the `g` flag, plus `i` when case sensitivity is off. An empty Find field returns an error asking you to enter text to find. Invalid regex patterns fail with an error instead of corrupting the output.
When to use it
Renaming a term across a draft, normalizing spelling variants, stripping a repeated prefix, fixing a typo that appears dozens of times, and small regex cleanups (optional digits, `colou?r`-style variants, capture-friendly patterns). Test on a short sample before pasting a long document.
When not to use it
Do not regex-replace production configs you have not backed up. Do not use greedy `.*` patterns on huge pastes without checking a sample. This is not a full IDE refactor — it will not rename symbols across a codebase or respect string-vs-comment boundaries. Prefer the Character Remover when you only need to delete a character class with no replacement text.
How it compares to related tools
The Character Remover deletes classes without replacement text. The Whitespace Remover collapses spaces rather than swapping phrases. The Duplicate Line Remover is for whole-line uniqueness. Code formatters change whitespace according to language rules, not your search string.
Common mistakes
Replacing “cat” inside “category” because you used a short find string. Forgetting that Case sensitive defaults to off, so “Foo” also matches. Enabling regex when you meant a literal period (`.` matches any character). Using an empty find field. Skipping a preview on a short sample first.
Plain mode versus regex mode
Plain mode (regex off) treats the find string as literal characters — a period is a period, not “any character.” Regex mode compiles your find string with JavaScript regular-expression syntax. Use `colou?r` to match “color” and “colour,” `\d+` for digit runs, and escape special characters when you mean them literally. Case sensitivity applies in both modes: off adds the `i` flag for regex, or a case-insensitive literal scan for plain mode.
Safety, multiline text, and empty find
Always keep a copy of the original paste. Preview on a short excerpt when the pattern is new. Plain and regex modes both search the whole string, including newlines if they appear in the find text; for multiline regex, match `\n` explicitly. An empty Find field does not silently no-op — the tool reports that you must enter text to find. Invalid regex yields an error message rather than partial output.
Frequently asked questions
Does find and replace support regex?+
Yes. Enable Use regular expression when you need patterns. Leave it off for literal punctuation like periods.
Is matching case-sensitive by default?+
No. Case sensitive defaults to off, so “foo” matches “Foo” and “FOO.” Turn the option on when only the exact case should match.
Can I replace across line breaks?+
Plain mode searches the whole string, including newlines if they are part of the find text. For multiline regex, use patterns that match `\n` explicitly.
What if my regular expression is invalid?+
The tool shows an error and does not invent a partial result. Fix the pattern (unescaped parentheses, bad quantifiers, and similar) and try again.
Will this rename symbols in my whole project?+
No. It only transforms the text you paste here. It does not open files on disk or understand programming scope.
Is my text uploaded?+
No. Find and replace runs in this browser. Nothing is sent to a server to transform the text.
Does CaseSwitch upload this text?+
No. Conversion, cleaning, and counting for this page run in your browser. Drafts are not sent to CaseSwitch for processing.
Related tools
Character Remover
Cleaning invoice numbers out of a description, removing emoji from a slug candidate, stripping punctuation before a frequency count, deleting a separator from a pasted column, and preparing a string for a case converter when leftover marks would become part of a token.
Remove Text Formatting
Cleaning chat messages that used *bold*, turning a Markdown outline into a meeting agenda, preparing text for a case converter, and peeling markers from a CMS paste.
Whitespace Remover
Cleaning CSV cells, tightening pasted UI copy, normalizing Slack or email spacing before a character count, and preparing text for a case converter or duplicate-line pass when padding would create false unique lines.
Duplicate Line Remover
Deduping email lists, unique-ifying a keyword list, cleaning a changelog pasted twice, preparing a column for import, and removing repeated headers from a log extract. Use it when duplicates are exact line repeats and you want to keep original order. Pair with the Whitespace Remover first if trailing spaces or mixed tabs make visually identical lines look different to you but not to the tool.
Remove Line Breaks
PDF copy-paste, OCR output, old plain-text emails, chat logs wrapped at a fixed width, and comments that wrapped at column 80 when you wanted a single string for a CMS or spreadsheet cell.