About the Filter Text Lines
Large texts, logs and lists often need trimming down to the lines that matter, or cleaning of the lines that do not. This tool filters by a rule. Type the text to look for, choose whether a line matches when it contains, starts with, ends with or exactly equals it, or matches a pattern, and then choose whether to keep or remove those lines. Capital letters can be ignored. The note says how many lines were kept and removed. It works in your browser, and your text is not uploaded.
Updated October 2026
How to use the Filter Text Lines
- 1Paste your lines into the left box.
- 2Type the text or pattern to look for.
- 3Choose how a line should match it.
- 4Choose to keep the matching lines or remove them.
- 5Copy the result or download it.
Filtering by rule
Log files, exports and email lists are full of lines you do not need. Keeping only the errors from a log, only the addresses from one domain or only the products with a certain code takes seconds with a filter. Removing lines is just as useful: strip comments, debug lines or test entries before you share.
Filtering keeps the original order, so the result reads like the source.
Match types
Contains finds the text anywhere in the line. Starts with and ends with look at one end only. Exactly equals needs the whole line to match. A pattern gives full flexibility, but characters such as the dot and the plus sign have special meanings.
- Contains: anywhere
- Starts with: beginning
- Ends with: end
- Pattern: regular expression
Combine filters
You can run the tool twice: first keep lines that contain one word, then remove lines that contain another. Each run takes the previous result as its input.
Examples
From a log with the lines error: disk full, info: started, warning: low memory, error: timeout and info: finished, keeping lines that contain error leaves the first and fourth lines, and removing them leaves the other three. The pattern ^(error|warning) keeps the first, third and fourth lines.
The note under the result says how many lines were kept and removed out of the total.
Phone and computer
On a phone, paste into the box, adjust the match type and the keep or remove choice, and tap Copy to carry the result into another app. On a computer you can also download it as a file. The two boxes sit side by side on a wide screen and one above the other on a narrow one, so you can compare input and result without zooming. Nothing you paste is uploaded or stored.
Good to know
The matching works line by line, so a word that wraps across lines in your source is judged on each line separately. An empty text gives an empty result, and an empty search box shows a message. If a pattern is not valid, nothing is changed and the error explains what to check. For complex rules, build and test the pattern in Regex Tester first. After filtering, Remove Duplicate Lines clears repeats and Extract Line Range keeps only a block of lines by number.
Features
- Contains, starts with, ends with, exact or pattern
- Keep or remove the matches
- Optional case-insensitive match
- Shows lines kept and removed
- Regular expressions supported
- Private: nothing is uploaded
Frequently asked questions
How do I keep only the lines that contain a word?
Type the word, choose contains and choose keep. All other lines are removed.
How do I delete lines that contain a word?
Choose remove instead of keep.
Can I filter with a pattern?
Yes. Choose the pattern option and type a regular expression, for example ^error|^warning for lines that start with either word.
Is this the same as grep?
It does the same job as the grep command on a text you paste, without needing a terminal.
Are capital letters ignored?
By default yes. Untick the option for exact case matching.
Is my text uploaded?
No. Filtering is done in your browser.