Filter Lines Online
Filter the lines of a list or text: remove lines that contain (or don't contain) certain text. Choose Remove or Preserve, match at start/end, and ignore case. Free and private—runs in your browser.
Original text
The list or text you want to filter (one line per row)
Options
Remove the lines that meet the criteria, or preserve them.
Min: 1 character
Filtered text
Tool Introduction
Filter Lines is a free online tool that lets you filter the lines of a list or block of text by whether they contain a given word or phrase. You can remove lines that match (so you keep the rest) or preserve only the lines that match (and drop the rest). Refine results with options: require the text at the beginning or end of the line, and turn ignore case on or off. Perfect for cleaning logs, stripping empty or comment lines, extracting lines with a keyword, or trimming lists. All processing runs in your browser—nothing is sent to any server—so your data stays private.
How to Use Filter Lines
- Paste or type your text in the "Original text" area (one line per row).
- Choose Remove or Preserve: Remove = delete matching lines; Preserve = keep only matching lines.
- Enter the text to search for in "Text present in line" (min 1 character). Try the "Try demo" button to see an example.
- Optional: Check "at the beginning" or "at the end" to restrict where the text must appear; check "Ignore case" for case-insensitive matching.
- Copy, download, or open the filtered result in a new tab.
Key Features
- Remove or Preserve: Delete lines that contain the text, or keep only lines that contain it.
- Flexible matching: Match text anywhere in the line, or require it at the start or end.
- Ignore case: Match regardless of uppercase/lowercase.
- Instant result: Filtered text updates as you type.
- Copy, download, open in new tab: Use the result however you need.
- 100% private: All processing in your browser; no data sent to servers.
Use Cases
- Remove empty lines or lines containing a keyword (e.g. "DEBUG", "TODO")
- Extract only lines that contain a word or phrase (e.g. "error", "@gmail.com")
- Strip comment lines (e.g. lines starting with "#" or "//")
- Clean logs or CSV-style data by keeping or removing lines with a pattern
- Filter lists (emails, URLs, names) by a substring or domain
FAQs
What does Remove vs Preserve mean?
"Remove" deletes every line that contains (or starts/ends with) the text you enter—you get the lines that do not match. "Preserve" keeps only the lines that match and removes the rest. Use Remove to strip out unwanted lines (e.g. empty lines, debug lines); use Preserve to extract only lines that contain a keyword.
What is "Text present in line"?
It's the text or phrase you want to filter by. Each line is checked for this text. If "Remove" is selected, lines containing it are removed; if "Preserve" is selected, only lines containing it are kept. You must enter at least one character. The search can be case-sensitive or case-insensitive (see "Ignore case").
When do I use "at the beginning" or "at the end"?
Check "The text must be present at the beginning of the line" to match only lines that start with your search text (e.g. lines starting with "ERROR" or "•"). Check "at the end" to match only lines that end with your text (e.g. lines ending with ".com"). Leave both unchecked to match the text anywhere in the line.
What does "Ignore case" do?
When "Ignore case" is checked, the tool treats uppercase and lowercase as the same (e.g. "the", "The", and "THE" all match). When unchecked, the match is case-sensitive, so only the exact casing matches. Ignore case is useful for general filtering; turn it off when you need to match a specific pattern like "ID" vs "id".
Is my text private?
Yes. All filtering runs in your browser. No text is sent to any server. Your lists and content never leave your device, so you can filter sensitive or confidential data safely.
Can I filter by multiple words or regex?
The tool filters by a single search string (one phrase). To filter by multiple different words, run the tool more than once: filter once, then use the result as input and filter again. Regular expressions are not supported—the search is for plain text (optionally at start/end of line and case-insensitive).