Word Filter

Keeps only the words that contain your keyword (case-insensitive), or with the invert option, keeps only the words that don't, rejoining the survivors with spaces. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Pulling only the words that mention a specific term out of a block of text, or specifically excluding words that do, is a common but tedious manual task when done by eye.

This tool automates it with a single keyword and an invert toggle.

What Is Word Filter?

A word filter that keeps (or, with the invert option, discards) every word containing your keyword, matched case-insensitively, and rejoins the result with single spaces.

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 Filter Works

The input is split into words on whitespace, and each word is tested for whether it contains the keyword (lowercased for a case-insensitive comparison); matching words are kept or discarded depending on the invert toggle, then rejoined with spaces.

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

When To Use Word Filter

Use it to pull every word mentioning a term out of a paragraph, or to strip out words matching an unwanted pattern before further processing.

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 String Line Filter and Text Sorter.

Features

Advantages

  • Case-insensitive by default, matching common expectations for quick text search.
  • Invert option covers both 'keep matches' and 'remove matches' use cases.
  • Matches on a substring rather than a whole word, so a single keyword catches every inflection and compound built from it.

Limitations

  • Rejoins output with single spaces, so original line breaks and multiple spaces between words are not preserved.
  • Removes the discarded words without leaving any marker, so the output gives no indication of where they sat.

Examples

Keeping words containing 'cat'

Input

The cat sat near the category sign and a dog barked

Output

cat category

Only 'cat' and 'category' contain the keyword 'cat', so the rest are dropped.

Best Practices & Notes

Best Practices

  • Use Sentence Filter instead if you need to keep whole sentences rather than individual words.
  • Use a longer keyword when a short one over-matches, since a two- or three-letter fragment turns up inside a great many words.
  • Invert the filter to strip a known term and read what remains, which is often quicker than listing everything you want to keep.

Developer Notes

Matching lowercases both the word and the keyword before calling String.prototype.includes(), the same approach used by the line-filter tool, applied at word granularity via `split(/\s+/)`.

Word Filter Use Cases

  • Pulling every mention of a term out of a paragraph
  • Removing words matching an unwanted keyword before further processing
  • Quickly scanning a pasted block for matching words

Common Mistakes

  • Expecting whole-word-only matching; 'cat' also matches inside 'category' since it's a substring match.
  • Expecting the original layout to survive; every surviving word is rejoined with a single space and the line structure is discarded.

Tips

  • Use the invert toggle to quickly flip between 'show matches' and 'hide matches' without retyping the keyword.
  • Filtering for a common suffix such as 'ing' or 'tion' is a quick way to survey which verb or noun forms a text leans on.

References

Frequently Asked Questions