Line Filter
Paste text, enter a word or phrase, and instantly keep or remove matching lines
Paste any block of text, type a keyword or regex pattern, and strip out (or keep) every line that matches — great for cleaning logs, trimming CSV exports, or pulling specific entries from config files. And everything runs in your browser. Nothing gets uploaded.
How It Works
The tool splits your input on every newline, then checks each line against your filter term. In "Remove" mode it drops every line that matches. In "Keep" mode it does the opposite — only matching lines survive. Turn on regex mode and your filter becomes a full regular expression, so patterns like error|warn or ^2024-03 work perfectly.
Examples
Cleaning up a server log
You only care about error entries in a mixed log file. Set mode to "Keep lines" and filter for "ERROR".
2024-03-12 INFO User login
2024-03-12 ERROR DB timeout
2024-03-12 INFO Page loaded
2024-03-12 ERROR Null pointer
2024-03-12 WARN Low memory
2024-03-12 ERROR DB timeout
2024-03-12 ERROR Null pointer
Removing test data from a contact list
Before exporting, strip out any rows with "@test.com" addresses. Mode: "Remove lines", filter: @test.com
[email protected], Alice
[email protected], Test Bot
[email protected], Bob
[email protected], QA Tester
[email protected], Alice
[email protected], Bob
Regex: keeping only lines that start with a number
Mixed notes file where numbered items are scattered between headings and blank comments. Enable regex, mode "Keep lines", pattern: ^\d
Meeting Notes
1. Finalize budget
Action items below
2. Send invoice
-- reviewed --
3. Update roadmap
1. Finalize budget
2. Send invoice
3. Update roadmap
Who Uses This
Stripping debug lines or filtering logs by severity level before sharing with the team.
Pulling out rows that match a category or removing headers and footers from raw exports.
Cleaning up keyword lists by removing duplicates or irrelevant terms in bulk.
Filtering config files or /etc/hosts entries to find lines with a specific IP or hostname.
Common Mistakes
Filtering for "error" when the log says "ERROR" returns zero matches. Toggle case sensitivity off if capitalization varies.
Typing 192.168.1.1 without regex mode still works — but in regex mode the dots match any character. Escape them as 192\.168\.1\.1 or just keep regex off for literal searches.
"Remove" and "Keep" are opposites. If your output is empty, you probably picked the wrong one. Quick sanity check: "Keep" means the filter term is what you want.
Technical Details
- Processing: 100% client-side — nothing leaves your browser
- Browser Support: Chrome, Firefox, Safari, Edge
- Regex Engine: JavaScript native RegExp (ECMAScript syntax)
- Max Input: Limited only by your browser's available memory
Frequently Asked Questions
How do I filter lines containing a specific word?
Paste your text, type the word in the filter box, and set the mode to "Keep lines." Hit Filter and you will get only the lines that include that word. No regex needed for simple word matching.
Can I use regular expressions to filter lines?
Yes. Turn on the regex toggle and your filter term is treated as a JavaScript regular expression. Patterns like ^ERROR, \d{3}, or foo|bar all work. If your pattern has a syntax error the tool will let you know.
Is my text uploaded to a server?
No. The entire tool runs in your browser using JavaScript. Your text never leaves your machine, which makes it safe for confidential data like logs, credentials, or personal information.
What's the difference between Remove and Keep mode?
"Remove" deletes every line containing the filter term. "Keep" does the opposite — it throws away everything that doesn't match and gives you only the matching lines. Think of Keep as a search and Remove as a cleanup.
How do I filter lines without caring about uppercase or lowercase?
Toggle the case-sensitivity option off. With it disabled, filtering for "error" matches "Error", "ERROR", and "eRRoR" equally. It's off by default on most setups so you may not even need to change anything.