Find and Replace Text Online
Paste your text, type what to find and what to replace it with, and the result rewrites itself as you type. A live counter shows how many replacements were made, and a Copy button grabs the output. Toggle regex for pattern matching, case sensitivity for exact letters, and replace-all to switch between every match and just the first.
How to find and replace text
- Paste or type your source into the 'Your text' box.
- Enter the text or pattern to look for in the 'Find' field.
- Enter the replacement in the 'Replace with' field, or leave it blank to delete matches.
- Tick 'Regex' for patterns, 'Case sensitive' for exact letter case, or untick 'Replace all' to change only the first match.
- Check the replacement count, then click Copy to take the result from the Result box.
Examples
Swap a word everywhere (literal, replace all)
color, colors, colorful
colour, colours, colourful (3 replacements)
Mask every number with a regex pattern
Order 12 and 345, find \d+, replace #
Order # and # (2 replacements)
Reorder names using capture groups
John Smith, find (\w+) (\w+), replace $2 $1
Smith John (1 replacement)
Frequently asked questions
What is the difference between literal and regex mode?
Literal mode matches your exact text, so a dot only matches a dot and special characters lose their meaning. Regex mode compiles the find field as a JavaScript regular expression, so you can match digits, word boundaries, or repeated characters.
How does case sensitivity work?
When 'Case sensitive' is on, the default, 'Apple' and 'apple' are treated as different strings. Untick it and the search adds the ignore-case flag, so a word matches regardless of how it is capitalized.
Can I replace only the first match?
Yes. Untick 'Replace all' to change just the first occurrence in the text. Leave it ticked, the default, to replace every match. The counter reflects whichever mode you choose.
What regex patterns can I use?
Standard JavaScript regex works. For example \d+ matches runs of digits, \s+ matches whitespace, and \bword\b matches a whole word. Anchors, character classes, and quantifiers are all supported.
Can I reference capture groups in the replacement?
Yes. In regex mode, parentheses in the find field create groups you can reuse with $1, $2 and so on in the replacement. Finding (\w+) (\w+) and replacing with $2 $1 swaps two words around.
What happens if I leave the find field empty?
Nothing changes. An empty find string returns your text untouched with a count of zero, so you never accidentally flood the output with the replacement value.
What happens with an invalid regex?
If the pattern cannot be compiled, the tool shows an 'Invalid regular expression' message in red and leaves your text unchanged, so a typo in a pattern never mangles the input.
Is there a size limit?
There is no fixed cap. Because the work happens in your browser, the practical limit is your device memory. Very large regex patterns with heavy backtracking can be slow, but ordinary find and replace stays instant.
Is my text private?
Yes. Everything runs locally in your browser and nothing is uploaded to a server, so confidential text and the terms you search for never leave your device.
Learn more
- A practical guide to regex find and replace
Move beyond literal search with patterns, capture groups, and case control, plus the pitfalls that trip people up when editing text.
Related tools
Case Converter
Convert text between UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE. Free and private.
Remove Line Breaks
Remove line breaks and paragraph breaks from text online. Flatten copied text into one line, keep spaces tidy, then copy the result. Free and private.
Acronym Generator
Turn any phrase into an acronym from the first letter of each main word. Skip small words like the and of, keep them, or add dot separators.
Add Line Numbers
Add line numbers to any text online. Set the start value, step, and separator, pad numbers to align, and copy or download the result. Free and private.
AI Sentiment Analyzer
Analyze the sentiment of any text with AI in your browser. Paste a review or comment, get a positive or negative score plus a per-sentence breakdown.
AI Text Summarizer
Summarize any text with AI, right in your browser. Paste an article, pick a length, and get a short abstractive summary. Nothing is uploaded.