Home / Filter lines

Filter lines

Keep only the lines you need, or delete the ones you do not: lines that contain a word, start or end with it, match it exactly or match a regular expression.
Your text never leaves your device: everything runs in this page. No upload, no sign-up.

Your lines

Empty

Result

How to filter lines

  1. Paste your lines: a log, a list, a CSV export.
  2. Choose Keep lines or Remove lines, and how to match: contain, start with, end with, are exactly, or match a regular expression.
  3. Type the word or words to look for, one per line. The result updates as you type.

Several words at once

With several words, a line matches if it has any of them. Switch on Line must have all of them to keep only lines that have every word. For example, keep lines containing ERROR and timeout.

Options

  • Match capitals: off by default, so error also finds ERROR.
  • Whole words only: cat finds "cat" but not "category".
  • Regular expressions: for patterns, such as ^\d{4}- for lines starting with a year or @gmail\.com$ for Gmail addresses. Spaces around a line are allowed for start with, end with and exactly.
  • are empty and contain a number need no word: remove empty lines, or keep only lines with a number.

Related tools

Questions

How do I remove lines containing a word?

Choose Remove lines, contain, and type the word. Every line with it disappears from the result.

How do I keep only lines that contain a word?

Choose Keep lines, contain, and type the word.

How do I remove empty lines?

Choose Remove lines that are empty.

Does it support regular expressions?

Yes. Choose match a regular expression. JavaScript syntax is used; invalid patterns show an error.