Find and replace saves time when the same name, URL, number, spelling, or placeholder appears throughout a block of text. Instead of editing every occurrence manually, you can review the matches and change one or all of them in a controlled step.

The Magical Toolz Find & Replace Text tool works with pasted text or a local TXT file. It supports ordinary text search, regular expressions, case matching, whole-word matching, multiline patterns, selected replacement, Replace All, Undo, copy, and TXT download.

Quick answer: Paste or import your text, enter the search value and replacement, inspect the highlighted matches, then replace the selected match or every match. Keep an original copy when the text matters.

How to find and replace text online

  1. Open the Find & Replace Text tool.
  2. Paste your source into the editor, or import a plain .txt file.
  3. Enter the exact text or pattern in the Find field.
  4. Enter the new text in Replace with.
  5. Choose optional matching controls only when you need them.
  6. Review the highlighted matches and match count.
  7. Use Replace selected for one occurrence or Replace all for the complete set.
  8. Copy the result or download the edited text as a TXT file.

The review step matters. A short search such as in may also appear inside words such as inside or printing. Whole-word matching or a more specific phrase can prevent unintended edits.

What each matching option does

OptionWhat it changesWhen it helps
Regular expressionTreats the Find value as a JavaScript regex pattern.Variable numbers, spacing, repeated formats, or line patterns.
Match caseTreats uppercase and lowercase letters as different.When Apple and apple should not receive the same edit.
Whole wordWraps the search in word boundaries.Changing cat without matching it inside catalog.
Multiline anchorsLets ^ and $ work at line boundaries in regex mode.Finding content at the start or end of each line.
Dot matches newlineLets a regex dot include line breaks.Matching a pattern that can continue across several lines.

Leave these options off for a simple exact-text replacement. Extra controls do not improve an ordinary search; they only change which text qualifies as a match.

Replace one occurrence or replace all?

Replace selected is safer when the same word has different meanings. Use Previous and Next to move through highlighted matches, check the surrounding sentence, and change only the selected occurrence.

Replace all is useful for an exact repeated value, such as an old domain, product code, placeholder, or company name. Before using it, compare the match count with what you expect. If a document should contain 12 old URLs and the preview finds 94, narrow the search first.

A controlled before-and-after example

Suppose your draft contains an old support address in headings, paragraphs, and a footer. Search for the complete old address instead of a short domain fragment. The preview lets you check whether each match is really part of the migration.

If one occurrence belongs to a quoted historical example, you don't have to change it. Move through the results and use Replace selected for the valid occurrences. If every match has the same purpose, you can use Replace all after confirming the count.

Run the old-address search again when you're finished. A zero-match result confirms that the exact source value no longer remains, although it can't prove that every newly inserted address is correct. Read several edited sentences and test important links separately.

Literal search examples

Update an old URL

Search for the complete old address, including https:// when it appears in the source. Replace it with the new address and inspect punctuation around each result.

Change a project name

Use Match case if an uppercase abbreviation and a normal word share the same letters. Whole word can stop the project name from matching inside another term.

Remove a repeated phrase

Leave Replace with empty. The tool will remove each selected match. Check spacing afterward because deleting words can leave double spaces or awkward punctuation.

Correct repeated punctuation

You can replace two spaces with one space or change a repeated symbol. Run the search again after the first pass if the source contains longer runs.

Regex examples you can review safely

Regex is powerful, but it should solve a specific pattern problem. If exact text works, use exact text.

  • \s{2,} finds runs of two or more whitespace characters.
  • \bcat\b finds the whole word cat.
  • ^Draft: with multiline anchors finds Draft: at the beginning of a line.
  • Order-\d+ finds values such as Order-24 and Order-105.

Test patterns on a copy first. Replacement text in regex mode can use JavaScript replacement behavior, so special replacement sequences may have meaning. If you only need literal text, turn regex off.

Replacement text can have special meaning in regex mode

A regular expression doesn't only control what is found. JavaScript replacement strings can refer to the complete match or captured groups. That is useful when you intentionally need to rearrange a pattern, but it can surprise you when a dollar sign was meant as ordinary text.

Test one selected occurrence before a broad replacement. If the result contains unexpected source text or missing characters, undo it and review the replacement string. Don't experiment on the only copy of a contract, configuration, or production list.

The active tool doesn't provide a separate literal-replacement escape switch in regex mode. For an ordinary phrase with ordinary replacement text, keep Regular expression disabled.

Limits of the current tool

  • Imported TXT files are limited to 2 MB.
  • The imported text is read up to 500,000 characters.
  • A search pattern is limited to 1,000 characters.
  • The live preview stops after the first 10,000 matches.
  • Patterns that match an empty position are rejected to prevent unsafe replacement loops.
  • Undo keeps up to 30 previous replacement states in the current browser session.
  • The download is plain TXT, not a Word, PDF, spreadsheet, or rich-text document.

These limits keep a browser-based workflow manageable. For very large files, complex document formats, or repeatable production changes across folders, use an editor or script designed for that workload.

What the tool does not preserve

This is a plain-text workspace. It does not preserve fonts, colors, images, tables, tracked changes, comments, spreadsheet formulas, or page layout. Pasting formatted text strips the task down to its text content.

If you need to edit a DOCX, PDF, HTML template, source-code project, or spreadsheet while preserving structure, use software made for that format. A plain replacement can break markup or code when the match crosses syntax boundaries.

Line endings, tabs, and invisible differences

Text copied from different systems can contain Windows or Unix line endings, tabs, non-breaking spaces, curly quotes, and visually similar Unicode characters. Two values may look identical while their underlying characters differ, so a search can return fewer matches than you expect.

Start with a literal search copied from the source. If it still doesn't match, inspect the surrounding spaces and line breaks. Regex whitespace patterns can help, but they can also span more content than intended when Dot matches newline is enabled.

After downloading TXT, open it in the application that will actually consume it. That final check can reveal an encoding or line-ending expectation that isn't visible in the browser preview.

Use a repeatable editing workflow

  1. Keep an unchanged source file.
  2. Write down the exact old and new values.
  3. Preview the match count before replacing anything.
  4. Replace one representative match and inspect it.
  5. Run Replace all only when the pattern is unambiguous.
  6. Search for the old value again.
  7. Review several changed locations in context.
  8. Download the result and test it in its destination.

This small checklist makes repeated edits easier to verify. It won't replace version control or document review, but it gives you evidence that the intended value was found, changed, and checked.

Privacy and safe handling

The active tool performs matching and replacement in the browser. TXT import uses the browser’s local file-reading feature, and the edited TXT download is created by the browser. The tool does not need to upload the text to a replacement server for this workflow.

Local processing does not remove every privacy risk. Avoid working with passwords, private keys, authentication tokens, or confidential records on a shared device. Check clipboard history, browser extensions, synced download folders, and device access when the text is sensitive.

Common mistakes and fixes

Too many matches appear

Use a longer phrase, enable Whole word, enable Match case, or revise the regex. Do not continue until the preview makes sense.

No matches appear

Check spaces, punctuation, capitalization, curly quotes, and line breaks. Turn Match case off if capitalization should not matter.

The regex reports an error

Check brackets, parentheses, backslashes, and quantifiers. The tool also rejects zero-length patterns. Switch regex off if the input should be treated literally.

The formatting disappeared

The output is plain text. Return to the original document and use its native editor when formatting must remain.

Undo does not restore an older version

Undo covers recent replacements in the current session and stores up to 30 states. It is not permanent version history. Keep the source file separately.

A practical review checklist

  • Does the preview show the expected number of matches?
  • Should capitalization matter?
  • Could the search appear inside a longer word?
  • Will an empty replacement leave extra spaces?
  • Does the new wording still read naturally?
  • Did you keep an unchanged source copy?
  • Does TXT output suit the final destination?

Frequently asked questions

Can I use regular expressions?

Yes. Enable Regular expression and review the live matches before replacing. Patterns are limited to 1,000 characters.

Can I replace only one match?

Yes. Use Previous or Next to select a highlighted occurrence, then choose Replace selected.

Is the search case-sensitive?

It is case-insensitive by default. Enable Match case when uppercase and lowercase letters should be treated differently.

Can I import a file?

Yes. The current tool accepts plain TXT files up to 2 MB and reads up to 500,000 characters.

Can I undo Replace all?

Yes, within the current session. The tool keeps up to 30 previous replacement states.

Does it preserve Word or PDF formatting?

No. It is a plain-text tool and downloads TXT output.

Does the text go to a replacement server?

No. The active workflow performs matching, replacement, TXT import, and download in the browser.

Finish with a checked result

Find and replace is most useful when it removes repetition without removing control. Start with an exact search, inspect the highlighted matches, and use selected replacement when context varies. Use Replace all only when the preview confirms the complete set.

When you are ready, open the Find & Replace Text tool, work on a copy, and check the downloaded TXT before using it elsewhere.