Text line filter
Keep or remove lines containing, starting with, ending with or exactly matching literal text.
How it works
Choose include or exclude, and optionally ignore case using locale-independent lowercase conversion. Match a literal substring (default), the entire line, the start or the end of a line, not a regular expression. Original line contents, duplicates and order are preserved. Optionally prefix retained lines with their original one-based line numbers. CRLF and CR become LF. A final newline is a terminator and is retained when any lines remain. Empty input has zero lines. Empty queries or queries containing CR or LF are rejected; spaces are significant.
Filter a list without changing its lines
With the example above, keeping lines that contain apple while ignoring case returns Apple pie and apple tart in their original order. Excluding matches returns Orange juice and Pear. Choose Matches entire line to require equality instead. For example, with apple, pineapple and apple juice on separate lines, whole-line matching keeps only apple. Leading and trailing spaces remain significant; the case option applies in all four matching modes. A period, asterisk or bracket is ordinary text, not a pattern. Unlike find and replace, this removes or retains whole lines, and unlike duplicate removal it does not compare lines with each other.
Match the start or end of a line
Choose Starts with text and enter INV- to keep lines such as INV-104 but not Paid INV-104. Choose Ends with text and enter .pdf to keep report.pdf but not report.pdf.bak or report.pdf (with a trailing space). The query is literal, so the period is not a wildcard. Use Remove matching lines to exclude those prefixes or suffixes instead. Original numbering and case matching work in either mode.
Show original line numbers
Enable Show original line numbers to prefix each retained line with its position in the source, followed by a colon and space. For example, filtering the four sample lines above for apple returns 1: Apple pie and 3: apple tart. Excluding matches instead returns lines 2 and 4. Retained empty lines also receive their original number; a final newline terminator is not an extra line. Numbering changes only the output, not matching or line counts.
Copy line filter summary
Use Copy line filter summary to copy the four counts as tab-separated Metric and Value columns, without copying the input, query or filtered text. For Apple, Green apple, Pear, Red apple on separate lines, matching apple with case ignored gives total 4, matching 3, kept 3, removed 1. Remove matching lines instead gives kept 1, removed 3. The summary can still be copied when no lines remain.
Matching and limits
Source: up to 50,000 UTF-16 units; query: 1–1,000 units on one line; result: at most 100,000 UTF-16 units. Case-insensitive matching lowercases each line and the query independently; it is not full Unicode case folding, accent removal or locale-specific matching. Canonically equivalent spellings may differ. Empty lines count as lines, except the final newline terminator. If no lines remain, the result is empty. A retained empty line can also yield empty text; the line counts distinguish these cases. The tool processes text locally without storing it or uploading it.
Related: Find and replace · Remove duplicate lines · Whitespace cleaner · Alphabetical line sorter · Add prefix and suffix to lines · Remove line breaks.