RunTheTests
/

Find and Replace

Find and replace text, counting every match.

What you provide

How this calculation works

Every occurrence of the text you enter in "find" is replaced with the "replace" text, and the number of replacements is reported. Matching is literal, so special characters are treated as themselves.

What the results mean

Literal, not regex
A dot matches a dot, not any character. This is simpler and safer for plain replacements than a regular expression.
Replacements made
The count of occurrences actually changed. Zero means the search text was not found anywhere — usually a stray space or a different kind of quote character.
Case sensitivity
Matching respects capitalisation, so replacing "cat" leaves "Cat" untouched. That is the safer default for prose, where a capital usually starts a sentence you did not mean to rewrite.

Common problems and fixes

Nothing is found, but I can see the text right there
Almost always an invisible difference. A curly quote copied from a word processor is a different character from a straight one, a non-breaking space from a web page is not the space on your keyboard, and a trailing space is easy to include accidentally in the search field. Retype the search term by hand rather than pasting it.
It replaced parts of words I did not want touched
Matching is on the literal string, with no notion of word boundaries, so replacing "art" also hits "start" and "particle". Include the surrounding spaces in both fields — search for " art " rather than "art" — or make the search term long enough to be unambiguous.
The replacement needs a pattern, not a fixed string
This tool is deliberately literal, which is what most replacements need and avoids the surprises of regex metacharacters. For anything requiring a pattern — optional digits, alternatives, anchors — use a regex tester, where you can see what the pattern matches before committing to it.

Frequently asked questions

Can I use regular expressions?

No — this does literal matching only, which is what most replacements need and avoids the surprises of regex special characters. If you need pattern matching, a dedicated regex tester is the right tool.

Can I replace line breaks or tabs?

Not directly, because a textarea cannot express those as a search string. For joining wrapped lines use the line break remover, and for tidying stray tabs and repeated spaces use the whitespace cleaner — both do the job in one step and neither requires you to type an invisible character into a box.

Is my text uploaded?

No. The find and the replace both run on the value in the box, in your browser, and nothing is transmitted. That matters here more than it looks, since find-and-replace is most often used on exactly the documents people should not be posting to a third party — contracts, templates carrying client names, exported records being anonymised.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/find-and-replace/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="Find and Replace" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/find-and-replace/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in Text