Paragraph Filter

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

Runs locallyUpdated 2026-07-23

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.
  • Rejoins the surviving paragraphs with proper blank-line separation, so the filtered output keeps the same paragraph formatting as the input.

Limitations

  • Paragraph detection relies on blank lines between blocks, so text without blank-line separation is treated as a single paragraph.
  • Matches a single keyword as a plain substring, so it cannot combine several terms or search for a pattern.

Examples

Keeping paragraphs containing 'pricing'

Input

Intro paragraph about the product.

This paragraph covers pricing details.

A closing paragraph with no keyword.

Output

This paragraph covers pricing details.

Only the paragraph containing 'pricing' is kept; the others are dropped.

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.
  • Filter first and read second when working through a long document, since keeping each paragraph whole preserves the context around every match.
  • Run the Line Unwrapper first on hard-wrapped text, otherwise a wrapped line may not sit inside the paragraph you expect it to.

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.
  • Searching for a phrase that spans a line break inside a paragraph, which will not match because a newline sits between the words.

Tips

  • Use the invert toggle to quickly flip between 'show matches' and 'hide matches' without retyping the keyword.
  • Invert the filter to strip boilerplate sections, then run it again normally over what remains to isolate the paragraphs you actually want.

References

Frequently Asked Questions