Logo

MonoCalc

/

Find and Replace Text

Text
0 lines0 words0 chars0 B

Common cleanups

Mode:

Match:

Leave empty to delete every match.

Case sensitive

Whole word only

Interpret escapes

Multiline (m)

Dot matches newline (s)

Unicode (u)

Used by First N / Nth
0 replacements across 0 lines0 characters

Matches found

0

Replacements made

0

Lines affected

0

Word delta

0

0 lines0 words0 chars0 B

About This Tool

Find and Replace Text – Bulk Edit Any Text in Your Browser

A find and replace text tool does one job that everyone needs and almost nobody wants to do by hand: swapping every occurrence of one string for another across a whole document. Renaming a variable in a pasted code snippet, fixing a misspelled product name in a draft, changing a delimiter across thousands of CSV rows, or redacting identifiers in a support transcript are all the same operation underneath. This tool runs that operation entirely in your browser, so logs, config files, and unreleased copy never leave your device.

Literal mode versus regular expression mode

Literal mode is the safe default. Your search term is escaped before it is compiled, so characters like ., *, ( and ? match themselves instead of doing something clever. Searching for 1.5 finds 1.5 and not 145.

Regular expression mode hands the pattern straight to the JavaScript regex engine. That unlocks character classes, quantifiers, anchors, lookarounds, and — most usefully — capture groups. A pattern of ^(\w+), (\w+)$ with a replacement of $2 $1 turns Smith, John into John Smith on every line at once. The replacement field also understands $& for the whole match and $$ for a literal dollar sign.

Narrowing what counts as a match

Two switches do most of the work. Case sensitive decides whether Fox and fox are the same thing. Whole word only wraps your term in word boundaries so cat matches the standalone word but leaves cats and category alone. When a term begins or ends with a non-word character — think --flag or (x) — plain word boundaries would never match, so whitespace lookarounds are substituted automatically.

Occurrence scoping handles the cases where replacing everything is wrong. You can rewrite only the first match, only the last, only the Nth, or only the first N. Splitting one,two,three on its first comma alone is a one-click operation rather than a manual edit.

Line guards protect the parts you care about

Real documents have regions that must not change: a CSV header row, a licence comment, a frozen configuration block. A line range restricts replacement to a span of lines, and a skip pattern exempts any line matching a secondary regular expression — ^# leaves every comment untouched. Matches are counted after these guards are applied, so the number you see is the number that will actually change.

Preview before you commit
Nothing is written back into your text until you press Apply. The change preview shows removals struck through and insertions highlighted in place, and the match table lists every hit with its line and column so you can audit a large replacement before committing to it. Undo and Revert are always available afterwards.

Batch rules for dictionary-style cleanups

Some jobs are not one replacement but twenty — normalising British to American spellings, standardising terminology across research notes, or mapping a list of old URLs to new ones. Batch mode takes an ordered rule list and applies each rule sequentially over the text in a single pass, then reports a hit count per rule so you can see which rules did the work and which never fired. Order matters, because a later rule sees the output of the earlier ones; the tool warns you when two rules share the same search term for exactly that reason.

Escape sequences and safety guards

With Interpret escapes enabled, sequences like \n, \t, \r, \\, \xNN and \uXXXX in the Find and Replace fields become the characters they represent, which is how you convert tabs to commas or split a single line into many.

Regular expressions can also misbehave. A pattern that matches the empty string, such as a* or ^, would loop forever, so it is rejected with a clear message instead. Nested quantifiers that trigger catastrophic backtracking are contained by a match cap and a two-second time budget — you get a warning and partial results rather than a frozen tab. An invalid pattern reports the engine's own SyntaxError, so you learn where the unterminated group actually is.

Reading the statistics

Alongside the result text you get matches found, replacements made, lines affected, and the signed change in characters and words. The gap between matches found and replacements made is the fastest way to confirm that a scope or line guard did what you expected. Results can be copied, downloaded as a .txt file, or exported as CSV for the match list and the per-rule report.

Frequently Asked Questions

Is the Find and Replace Text free?

Yes, Find and Replace Text is totally free :)

Can I use the Find and Replace Text offline?

Yes, you can install the webapp as PWA.

Is it safe to use Find and Replace Text?

Yes, any data related to Find and Replace Text only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Find and Replace Text tool work?

It compiles your search term into a JavaScript regular expression — escaping every metacharacter first in literal mode — then walks the text once, recording the position of each match. Occurrence scoping and line guards decide which of those matches are actually rewritten, and the result is rebuilt by splicing the replacement into the original string, so untouched whitespace and line endings survive exactly as they were.

What is the difference between literal and regular expression mode?

Literal mode matches your search term character for character, so symbols like . * ( ) + ? are treated as ordinary text and nothing surprising happens. Regular expression mode hands the pattern straight to the regex engine, unlocking character classes, quantifiers, anchors, lookarounds, and $1 capture-group backreferences in the replacement.

Why does whole-word matching skip some results?

Whole-word matching wraps your term in word boundaries, so searching for cat matches the standalone word but not cats or category. When the term begins or ends with a non-word character such as a bracket or a hyphen, whitespace lookarounds are used instead, because a plain word boundary would never match there.

Can I replace only the first, the Nth, or the last occurrence?

Yes. The replacement scope selector supports all occurrences, first only, the first N, the Nth only, and the last only. Matches are counted after the line-range and skip-pattern guards are applied, so the numbering always reflects what you can actually see highlighted.

Is my text uploaded to a server?

No. Every match, replacement, and statistic is computed in your browser with plain JavaScript, and nothing is transmitted anywhere. That matters because find and replace is most often run over log excerpts, config files, support transcripts, and unreleased drafts.

What happens with a pattern that could freeze the page?

Match enumeration runs under both a 100,000 match cap and a two-second time budget, and a pattern that can match an empty string is rejected outright rather than looping forever. If either guard trips, the tool warns you that the results are partial instead of hanging the tab.