Overview
Introduction
Scanning a long document for the paragraphs that discuss a specific topic, or specifically excluding paragraphs that do, is slow to do by eye.
This tool automates it with a single keyword and an invert toggle.
What Is Paragraph Filter?
A paragraph filter that keeps (or, with the invert option, discards) every paragraph containing your keyword, matched case-insensitively, and rejoins the result with a blank line between each surviving paragraph.
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 Paragraph Filter Works
The input is split into paragraphs on blank lines, and each paragraph is tested for whether it contains the keyword (lowercased for a case-insensitive comparison); matching paragraphs are kept or discarded depending on the invert toggle, then rejoined with blank lines.
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use Paragraph Filter
Use it to pull every paragraph mentioning a topic out of a long document, or to strip out paragraphs matching an unwanted pattern before publishing.
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 Sentence Filter.
Features
Advantages
- Case-insensitive by default, matching common expectations for quick text search.
- Invert option covers both 'keep matches' and 'remove matches' use cases.
Limitations
- Paragraph detection relies on blank lines between blocks, so text without blank-line separation is treated as a single paragraph.
Examples
Best Practices & Notes
Best Practices
- Use Sentence Filter instead if you need finer-grained filtering within a paragraph rather than keeping or dropping it as a whole.
Developer Notes
Paragraphs are split with `/\n\s*\n/`, the same heuristic used elsewhere in this site's paragraph-based tools, then matched with a lowercased `String.prototype.includes()` check.
Paragraph Filter Use Cases
- Pulling every paragraph mentioning a topic out of a long document
- Removing paragraphs matching an unwanted keyword before publishing
- Quickly scanning a pasted document for relevant sections
Common Mistakes
- Pasting text without blank lines between paragraphs; the filter then treats the whole input as one paragraph.
Tips
- Use the invert toggle to quickly flip between 'show matches' and 'hide matches' without retyping the keyword.