Filter Words in Text
Keep or remove individual words matching a text or regex pattern from your text — filtering at the word level while preserving sentence structure.
What Does This Tool Do?
Unlike filtering whole lines, this tool operates on individual words within your text. You specify a pattern and choose whether to keep only words matching it or remove all words that match. The sentence structure and line breaks are preserved — only the matching (or non-matching) words are affected.
Key Features
How to Use This Tool
- Paste your text.
- Enter the word or pattern to filter on.
- Choose Keep matching or Remove matching.
- Toggle Regex and Case Insensitive as needed.
- Click Filter to apply.
How It Works
The text is split into individual tokens (words and whitespace). For each word token, it's tested against the pattern. Words that match (or don't match, depending on mode) are removed. The remaining tokens are rejoined, and extra spaces from removed words are cleaned up.
Common Use Cases
Frequently Asked Questions
Does it affect punctuation attached to words?
Punctuation attached to a word (like a period at the end of a sentence) is considered part of the word token. Removing a word also removes its attached punctuation.
How is this different from Filter Lines?
Filter Lines removes entire lines that match. Filter Words removes individual words within lines, leaving the rest of the line intact.
Related Tools
Link to This Tool
Copy and paste the code below to link to this tool from your website: