Text tool

Replace First Occurrence

Paste source text, enter a literal query and replacement, then replace the first match in your browser.

In-browser processingNo account requiredPrivacy details ↗

Replace First Occurrence

Literal matching only; the first non-overlapping match is replaced. Empty replacement is allowed. Each value is limited to 100,000 characters.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste source text.
  2. Enter the literal query; replacement may be empty.
  3. Replace the first match and copy the result.

First match only

Matching is literal and case-sensitive. Only source.indexOf’s first non-overlapping match is replaced; all other content is preserved.

Bounded local processing

Source, query, and replacement are each limited to 100,000 characters and stay in the browser.

GOOD TO KNOW

Common questions

Can the replacement be empty?

Yes. An empty replacement deletes the first match.

Are all matches replaced?

No. This focused tool replaces exactly one first match.

Is matching case-sensitive?

Yes. The literal query must match the same letter case.