--- title: "Find and replace — free, runs in your browser" description: "Replace every occurrence of a string in pasted text, with optional regex. Free, no sign-up, and nothing you enter leaves your browser." url: https://atoneplace.net/tools/find-and-replace/ site: "At One Place" --- # Find and replace Replace every occurrence of a string in pasted text, with optional regex. ## How it works Replaces every occurrence of one string with another. Case sensitivity is optional, and so is regular-expression mode for anything more structured than a literal string. In regex mode, capture groups are available in the replacement as $1, $2 and so on — so a pattern like (\w+), (\w+) with replacement $2 $1 swaps two comma-separated fields on every line. An invalid pattern reports the error rather than silently doing nothing. The match count is shown, which is the quickest way to confirm a pattern does what you think before you rely on the output. > This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected. ## Common questions ### Can I use regular expressions? Yes. Turn on regex mode and use capture groups in the replacement with $1, $2 and so on. ### How do I replace a literal dollar sign in regex mode? Escape it as \$ in the pattern. In the replacement, $$ produces a single literal dollar sign. ## Related pages - [Word and character counter](https://atoneplace.net/tools/word-counter/) - [Typing speed test](https://atoneplace.net/tools/typing-speed-test/) - [Remove duplicate lines](https://atoneplace.net/tools/remove-duplicate-lines/) - [Sort lines alphabetically](https://atoneplace.net/tools/sort-lines/) - [JSON formatter and validator](https://atoneplace.net/tools/json-formatter/) - [Text compare](https://atoneplace.net/tools/text-diff/) - [Regex tester](https://atoneplace.net/tools/regex-tester/) - [Case converter](https://atoneplace.net/tools/case-converter/) - [Remove empty lines](https://atoneplace.net/tools/remove-empty-lines/) - [Readability checker](https://atoneplace.net/tools/readability-checker/)