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.
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
Best Practices & Notes
Best Practices
- List every word you want redacted, separated by commas; only exact whole-word matches are censored.
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.