Word Censor

Finds every whole-word, case-insensitive occurrence of the word or comma-separated words you specify and replaces each one with asterisks matching that word's length, so the original word never appears in the output. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Redacting specific words from a block of text, such as names, secrets, or placeholder terms, is a common editing task before sharing a document publicly.

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

What Is Word Censor?

A redaction tool that replaces every whole-word, case-insensitive match of the word or words you specify with asterisks matching each matched word's length.

It's part of this site's String Tools collection and works entirely in your browser. It only ever produces asterisk characters in place of a match, never real words.

How Word Censor Works

The tool splits your comma-separated word list, escapes each word for safe use inside a regular expression, and builds a single case-insensitive, whole-word alternation pattern.

Every match in the input text is replaced with a run of asterisks equal in length to the matched text, preserving the surrounding text and spacing exactly.

When To Use Word Censor

Use it to redact names, codenames, or sensitive terms from a document, transcript, or sample text before sharing it.

It's also useful for building simple redacted examples or screenshots where a specific term needs to be hidden but its length should stay visible.

Often used alongside Find & Replace Tool and Text Anonymizer.

Features

Advantages

  • Matches whole words only, so it won't accidentally redact part of a longer word.
  • Case-insensitive matching means you don't need to list every capitalization variant.
  • Replaces each word with asterisks matching its own length, so the surrounding text keeps its original spacing and line structure.

Limitations

  • Only replaces exact whole-word matches you specify; it has no dictionary of profanity or sensitive terms built in.
  • Word boundaries rely on `\b`, so it may not behave as expected with words containing non-alphanumeric characters.

Examples

Censoring a single word

Input

The secret plan is secret.

Output

The ****** plan is ******.

Both case-insensitive whole-word occurrences of 'secret' are replaced with six asterisks, matching the word's length.

Best Practices & Notes

Best Practices

  • List every word you want redacted, separated by commas; only exact whole-word matches are censored.
  • Bear in mind the asterisk run still reveals the censored word's length, so use a fixed-width mask when even that is sensitive.
  • Include plurals and inflected forms in the list, since whole-word matching means 'secret' does not also cover 'secrets'.

Developer Notes

Target words are split on commas, trimmed, escaped with a regex-special-character escaper, and joined into a single `new RegExp(\`\\b(?:${pattern})\\b\`, "gi")` alternation, so all target words are matched in a single pass via `String.prototype.replace()`.

Word Censor Use Cases

  • Redacting sensitive terms from a shared document
  • Hiding a spoiler word in a text snippet
  • Building a redacted example for documentation or a screenshot

Common Mistakes

  • Expecting partial-word matches to be redacted; only whole words matching exactly are affected.
  • Forgetting to separate multiple words with commas, which causes the whole entry to be treated as one phrase.

Tips

  • Use a comma-separated list to redact several different words in a single pass.
  • Matching is case-insensitive, so listing a word once covers every capitalization it appears in throughout the text.

References

Frequently Asked Questions