Skip to content

Filter Lines

Keep or remove lines that contain a word, match a pattern or meet a length rule.

  • Free
  • Real-time
  • Runs locally
Filters as you type
Ln 1, Col 1

Filter

Action

Line

Enter text to filter by. With no text, only the length and empty-line rules apply.

Options

Line length (characters)

to

Only lines within this length are kept. Leave empty for no limit.

Kept

0

Removed

0

Matched

0

Lines with the text

Total lines

0

0 of 0 lines

Keep only the lines you need, or delete the ones you do not. Paste a list, a log file or CSV data, type a word, and every line containing it is kept or removed instantly, like grep in your browser.

Match lines that contain text, start or end with it, equal it exactly, or match a regular expression. Use several comma-separated terms with any or all logic, match whole words, filter by line length and drop empty lines. Nothing is uploaded.

01

How to filter lines

  1. STEP 01

    Paste your text

    Paste the list, log or data, one item per line.

  2. STEP 02

    Set the filter

    Choose keep or remove, how lines should match, and type the text or pattern to look for.

  3. STEP 03

    Copy the result

    Refine with case, whole-word, length and empty-line options, then copy or download the filtered lines.

02

Features

  • Keep or remove

    Show only matching lines, or delete them and keep everything else.

  • Five ways to match

    Contains, starts with, ends with, exact line or regular expression.

  • Several terms at once

    Separate terms with commas and match lines containing any of them or all of them.

  • Whole words and case

    Match whole words only so “cat” skips “category”, and choose case-sensitive matching.

  • Length filter

    Keep lines within a minimum and maximum number of characters; emoji count as one.

  • Safe regex

    Regular expressions run in a background thread and are stopped if they take too long.

03

Ideas for filtering lines

A few common ways to use the line filter:

  • Pull every ERROR or WARN line out of a server log.
  • Remove lines containing unsubscribe, test or example addresses from a mailing list.
  • Keep only CSV rows for one country or product code.
  • Find lines longer than 80 characters, or delete one-word lines.
04

Frequently asked questions

How do I keep only lines that contain a word?

Choose “Keep matching lines” and “Contains”, then type the word. Every line containing it is shown in the result; all other lines are removed.

How do I delete lines containing a word?

Choose “Remove matching lines” and type the word. Lines containing it are deleted and all other lines are kept.

Can I filter by several words?

Yes. Turn on “Several terms” and separate them with commas. Choose “Any term” to match lines containing at least one, or “All terms” for lines containing every term.

Can I use regular expressions?

Yes. Choose Regex and type a JavaScript regular expression such as ^(ERROR|WARN)\b. Patterns run in a background thread and are stopped after a few seconds if they are too slow.

How is line length measured?

In visible characters, the same way as our Character Counter, so an emoji or an accented letter counts as one character.

Is my text uploaded?

No. Lines are filtered in your browser and nothing is sent to a server.