Word Eraser

Masks every whole-word occurrence of one or more specified target words entirely with a repeated symbol matching that word's length, useful for redacting names, secrets, or sensitive terms before sharing text. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Redacting specific words from a passage, like a name or a secret term, by hand risks missing an occurrence or two, especially in a long document.

It runs entirely client-side, so nothing you paste is ever uploaded to a server.

What Is Word Eraser?

A word eraser that fully masks every whole-word occurrence of one or more target words with a repeated symbol sized to match the original word's length, for example 'secret' becomes '******'.

It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.

How Word Eraser Works

The target words are split on commas, escaped for safe regex use, and combined into a single case-insensitive word-boundary pattern, then every match is replaced with the mask symbol repeated to the match's length.

The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.

When To Use Word Eraser

Use it to redact a name, secret, or sensitive keyword throughout a document before sharing it, or to censor specific words in a sample text.

It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.

Often used alongside Word Letter Eraser and Find & Replace Tool.

Features

Advantages

  • Erases multiple different target words in one pass.
  • Word-boundary matching avoids accidentally masking substrings of unrelated words.

Limitations

  • Matching is exact per word form; a plural or different inflection of the target word won't be caught unless listed separately.

Examples

Erasing a target word

Input

The secret is safe.

Output

The ****** is safe.

The word 'secret' (6 letters) is replaced by 6 asterisks; other words are untouched.

Best Practices & Notes

Best Practices

  • List every inflection you want masked (e.g. 'run, running, ran') since matching is exact per word form.

Developer Notes

Target words are escaped with `word.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")` before being joined into `new RegExp(`\\b(?:${escaped.join("|")})\\b`, "gi")`, so words containing regex metacharacters are matched literally rather than as patterns.

Word Eraser Use Cases

  • Redacting a name or sensitive term before sharing a document
  • Censoring specific words in sample or demo text
  • Building a fill-in-the-blank exercise from source text

Common Mistakes

  • Expecting partial-word matches to be caught; only whole-word matches are erased.
  • Assuming plural or inflected forms are covered automatically.

Tips

  • Use the Word Letter Eraser instead if you want the word's shape to remain partially recognizable.

References

Frequently Asked Questions