Line filter
Keep or remove lines containing text, matching a pattern or meeting a length.
Bookmark this page
Keep this page handy for next time.
- On a computer
- Press Ctrl + D, or Command + D on a Mac.
- On a phone or tablet
- Open your browser's menu or Share menu and look for Add Bookmark, Bookmark or Add to favourites.
A bookmark saves the page link. Save any tool results separately.
How to use this tool
- Choose a match mode, then enter its text or JavaScript regular expression when needed.
- Choose whether to keep matching or non-matching lines.
- Run the filter and copy the remaining lines.
Things to know
- Regular expressions use JavaScript syntax. Cancel an expensive expression to stop its worker.
- Each text input accepts up to 5 MiB. Output is limited to 25 MiB and combined text settings to 1 MiB.
- Line-based modes accept up to 100,000 lines, including a trailing empty line.
You might also need
More in text & listsRemove duplicate lines
Remove repeated lines while retaining their original order.
Word finder
Find words by known letter positions, length, starting letters, ending letters and excluded letters.
Random word generator
Draw random English words for prompts and word games, with length, starting-letter and no-repeat filters.
Pangram and letter-set solver
Find words made from a set of letters, with an optional required letter and a filter for words using the whole set.
Remove extra spaces
Trim lines, collapse repeated spaces and remove blank lines.
Rhyming dictionary
Find words with matching sounds from the final stressed vowel, including alternate recorded pronunciations.
Line-ending converter
Convert newline characters to LF, CRLF or CR and download exact bytes.
Prefix and suffix editor
Add or remove literal prefixes and suffixes on every line.
Text diff
Compare two texts and produce a readable unified line diff.