Remove Lines Containing Text, or Keep Only Matches
Runs 100% in your browser — your text never leaves this page, and nothing is uploaded or stored.
This remove lines containing text filter deletes every line with a word or phrase you choose — or flips to keep only the matching lines. Use it to filter lines by keyword and delete lines with a word you choose — or flip the switch and keep only the matching lines, with a count of removed and kept lines.
How to Use the Remove Lines Containing Text Tool
- Paste your list or log into the box — or press Load sample to filter the example server log.
- Type the text to look for — a word, a phrase, a code like ERROR: anything a line might contain.
- Leave Keep only matching lines off to delete the matches, or tick it to keep only the matches and delete everything else.
- Tick Case sensitive only if capitals must match exactly; by default “error” and “ERROR” are the same needle.
- Read the result and its counter note, then copy it — or paste it back in and filter again with a second needle.
About this tool
Log files, exports and long lists usually contain a small signal buried in noise. This tool removes — or isolates — lines by any word or phrase you give it: strip every line mentioning a test user, keep only the ERROR lines from a server log, delete every product in a list that contains “discontinued”. Matching is plain text, not patterns. By default the tool looks for your text anywhere inside a line, ignoring case, so “error” finds “ERROR”, “Error” and the error inside “errors”. Tick Case sensitive when capitals matter. For whole-word precision, include the spaces around your word in the needle itself — the match is literal, so the spaces must be present to match. The Keep only matching lines option turns deletion into extraction. Instead of a cleaner you have a filter: from a ten-thousand-line log, keep only the lines mentioning one user, one order ID or one error; from a product export, keep only the lines in one category. Run it, copy the result, and the noise is gone for good. Two safety rails are built in. An empty needle changes nothing — the tool returns your text untouched rather than matching every line and wiping a document by accident. And the note under every result reports the exact split, so you can verify each pass before chaining another. All of it runs locally in your browser, safe for internal logs and customer lists.Worked example
Here is the sample server log that comes with the tool, with ERROR typed as the needle and the default settings: You pasteINFO: server started on port 8080 ERROR: failed to connect to database INFO: user login successful WARNING: disk usage at 85% ERROR: timeout while fetching data INFO: scheduled backup completedYou get
INFO: server started on port 8080 INFO: user login successful WARNING: disk usage at 85% INFO: scheduled backup completedThe note reads “2 lines removed · 4 lines kept.” — the two ERROR lines are gone and everything else survives in its original order. Tick Keep only matching lines with the same needle and you get exactly the opposite: just the two error lines, isolated and ready for a bug report.
Features
- Plain-text matching with no regex to learn — type the word or phrase exactly as it appears.
- Two modes in one tool: delete matching lines, or keep only matching lines as an extraction filter.
- Case-insensitive by default, with a case-sensitive option for codes, IDs and exact labels.
- A live counter under every result reporting lines removed and lines kept, so every pass is verifiable.
- An empty needle safely changes nothing — a filter cannot wipe a document by accident.
- Private by design: filtering happens in your browser — safe for internal logs and customer data.