Paste any list, log or CSV and keep only the lines that contain your words, or remove them. Match any or all terms, line starts and ends, exact lines or regular expressions, and see how many lines matched.
Last updated:
0 lines
Advertisement
Advertisement
How to use the Filter Lines Containing Text
Paste your text or open a .txt, .csv or .log file. Each line is checked separately.
Choose Keep or Remove for the lines that match.
Pick how a line matches (contains any term, all terms, starts with, ends with, exact or regex) and type your terms, one per line.
Set options such as Case-sensitive or Whole words only. The result updates as you type.
Copy or download the result, check the Filtered out tab, or click Use as input to filter again.
Match types explained
Match type
Term
Matches
Does not match
Contains ANY
red blue
red car · dark blue sky
green tree
Contains ALL
invoice paid
Invoice 204 paid
Invoice 205 overdue
Starts with
#
# comment line
value = 5 # note
Ends with
.jpg
photos/cat.jpg
photos/cat.jpg.bak
Is exactly
N/A
N/A
N/A (pending)
Regular expression
^\d{3}-\d{4}$
555-0199
Call 555-0199
Handy filters to copy
Clean up a log: Keep lines, contains ANY, terms error and warning. Switch to Remove to hide routine INFO and DEBUG noise instead.
Remove comments from a config file: Remove lines, starts with, term # (and // for code), with Trim spaces ticked so indented comments are caught.
Find rows in a CSV: Keep lines, contains ALL, terms such as 2026 and Paid. Note that the header row is filtered like any other line.
Lines with an email address: regular expression [\w.+-]+@[\w-]+\.[\w.]+.
Lines that are only numbers: regular expression ^\s*-?\d+(\.\d+)?\s*$.
Lines longer than 80 characters: regular expression ^.{81,}$.
Working on the command line? This tool does the same job as grep (keep matches), grep -v (remove matches), grep -i (ignore case) and grep -w (whole words), without installing anything.
Frequently asked questions
How do I remove all lines containing a specific word?
Paste your text, choose Remove matching lines, leave the match type on contains ANY of the terms and type the word in Terms. Every line that contains it disappears from the result, and the Filtered out tab shows the lines that were removed.
Is the search case-sensitive?
No, not by default: error matches Error and ERROR. Tick Case-sensitive when capital letters matter, for example to tell the code ID from the word id.
What is the difference between ANY and ALL?
With ANY, a line matches when it contains at least one of your terms (OR). With ALL, it must contain every term somewhere in the line (AND), in any order. To keep lines that contain none of the terms, choose ANY with Remove matching lines.
What does Whole words only do?
It stops a term from matching inside a longer word. With Whole words only, cat matches 'the cat sat' but not 'category' or 'concatenate'. Letters, digits and underscores count as word characters.
Can I use regular expressions?
Yes. Choose matches a regular expression and put one pattern per line; a line matches if any pattern matches. Patterns use JavaScript syntax, for example ^\d{4}- for lines starting with four digits or @example\.com$ for lines ending in that domain. Invalid patterns show an error instead of wrong results.
Is there a size limit?
There is no fixed limit. Files of many megabytes and hundreds of thousands of lines work in modern browsers; very large files simply take a moment longer. Your text never leaves your device.
Does it keep the original order of lines?
Yes. Lines stay in their original order. Turn on Add line numbers to see where each kept line came from, or open the Highlighted matches tab.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.