Skip to content

Find and Replace Text

Replace words everywhere at once, with regex if needed.

How to use the find and replace

Three steps, all in your browser.

  1. 1

    Add your text

    Type, paste or open a .txt file. Press Sample to try an example.

  2. 2

    Choose what to fix

    Switch options on or off. The cleaned text updates as you go.

  3. 3

    Copy or download

    Copy the result in one click or save it as a .txt file.

Find and Replace Text: what to know

Find and Replace changes every occurrence of a word or phrase in your text at once and shows how many matches it found. The result updates as you type the search and the replacement.

Matching ignores case unless you turn on 'Match case', and 'Whole word' skips matches inside longer words, so replacing 'cat' leaves 'category' alone. In plain mode the search and the replacement are taken literally, symbols included.

Turn on 'Regex' for regular expressions in JavaScript syntax. Use groups and $1, $2 or $<name> in the replacement, $& for the whole match, and \n or \t for a line break or tab. ^ and $ match at the start and end of each line. If the pattern is invalid, the error is shown and your text is left unchanged.

Popular uses

  • Renaming a person, product or term throughout a document
  • Fixing a repeated typo or outdated link
  • Reformatting dates and phone numbers with regex groups
  • Turning lists into comma-separated values and back

Tips for the best result

  • Check the match count before copying, to make sure you're changing what you expect.
  • Use 'Whole word' for short words that appear inside other words.
  • In regex mode, escape special characters such as . ( ) and ? with a backslash when you mean them literally.

Read how JustYourText works and our privacy details. Text you type or paste is processed in your browser and is never sent to our server.

Frequently asked questions

Turn on 'Regex' and type a JavaScript regular expression, such as \d+ for numbers. In the replacement, $1 inserts the first group, $& the whole match, and \n a line break. An invalid pattern shows an error instead of changing anything.

It only matches complete words: searching for 'cat' then skips 'category' and 'bobcat'.

No. Every tool runs in your browser, so the text you type or paste is processed on your device and is not sent to our server or stored. Reloading or closing the page clears it.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. The tools work in any modern browser on phones, tablets and computers. Copy and Download work on mobile too.