Keep only the lines that contain a search term, or remove every line that contains it - useful for narrowing a long list down to what you need, or stripping out rows that match an unwanted pattern.
Your text never leaves your browser. Everything is processed locally on your device.
Share:
Browser-only processing
Total lines
0
Non-blank lines
0
Blank lines
0
Words
0
Characters
0
Letters
0
Sentences
0
Input text
Result text
How do you use the filter lines tool?
1. Add your text. Paste it directly, upload a file, or drop a TXT/CSV/JSON file onto the input box.
2. Enter a search term and choose a mode. Pick "keep matching lines" or "remove matching lines," and whether the match should be case-sensitive.
3. Copy or download the result. Your filtered text is ready instantly, with nothing ever sent to a server.
Want to change text within lines instead of keeping or discarding whole lines? Try Find and Replace.
Frequently Asked Questions
What does "keep matching lines" vs. "remove matching lines" do?
"Keep matching lines" throws away every line that doesn't contain your search term, leaving only the lines that do. "Remove matching lines" does the opposite - it deletes every line that contains your search term and keeps everything else.
Does the search term need to match the whole line?
No - it matches if your search term appears anywhere within the line, as a substring. A search for "fruit" would match a line like "banana - fruit, sweet" because "fruit" appears somewhere in it, not because the whole line equals "fruit".
Can I search for a phrase instead of a single word?
Yes - the search term can be any text, including spaces, not just a single word. Searching for "out of stock" will match any line containing that exact phrase.
How is this different from Find and Replace?
Find and Replace changes text within lines but keeps every line. Filter Lines works at the line level instead - it decides whether to keep or discard entire lines based on whether they contain your search term, rather than modifying their contents.