Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Line Filter

Paste text, enter a word or phrase, and instantly keep or remove matching lines

Your files never leave your browser
Input0 lines
Filtered Output0 lines
Ready

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

Paste Text
→
Set Filter & Mode
→
Get Filtered Output

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".

INPUT
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
OUTPUT
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

INPUT
[email protected], Alice [email protected], Test Bot [email protected], Bob [email protected], QA Tester
OUTPUT
[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

INPUT
Meeting Notes 1. Finalize budget Action items below 2. Send invoice -- reviewed -- 3. Update roadmap
OUTPUT
1. Finalize budget 2. Send invoice 3. Update roadmap

Who Uses This

👨‍💻 Developers

Stripping debug lines or filtering logs by severity level before sharing with the team.

📊 Data Analysts

Pulling out rows that match a category or removing headers and footers from raw exports.

✍️ Content Writers

Cleaning up keyword lists by removing duplicates or irrelevant terms in bulk.

🛠️ SysAdmins

Filtering config files or /etc/hosts entries to find lines with a specific IP or hostname.

Common Mistakes

Forgetting case sensitivity is on

Filtering for "error" when the log says "ERROR" returns zero matches. Toggle case sensitivity off if capitalization varies.

Using regex characters in plain mode

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.

Choosing the wrong mode

"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

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.

Share: