Skip to content
Tezmy Tools

Grep Text

Keep or remove the lines of a text that contain a word, phrase or pattern

Add text and something to look for.

Runs in your browser. Nothing is uploaded.

About the Grep Text

Grep is a command that finds the lines of a file that match a pattern. This tool brings that to your browser. Paste any text with one item per line, type what you are looking for and the matching lines appear straight away. You can ignore capital letters, match whole words only, treat your pattern as a regular expression, show line numbers, or invert the match to keep only the lines that do not contain it, which also removes lines containing a word. It works on logs, lists, exported data, notes and anything else that is organised by line, and everything happens in your browser.

Updated October 2026

How to use the Grep Text

  1. 1Paste your text, with one item per line.
  2. 2Type the word, phrase or pattern to look for.
  3. 3Tick the options: ignore case, whole words, regular expression, invert, line numbers.
  4. 4Read the matching lines and the count of matches.
  5. 5Copy the result or download it as a text file.

Useful patterns

  • ^error finds lines that start with error
  • \.com$ finds lines that end in .com
  • \d{4} finds lines with four digits in a row
  • cat|dog finds lines with either word
  • ^$ finds empty lines

Everyday uses

Pull out the error lines from a log, find all the entries for one customer in an export, remove lines that mention a word you don't want, check which names in a list contain a surname or filter a list of web addresses by domain. Combine it with other tools: first filter with this one, then sort the result with Sort Lines or remove repeats with Remove Duplicate Lines.

Related tools

The Regex Tester helps you build and test patterns, Head and Tail Text takes lines by position, the Text Extractor pulls out emails, links and numbers, Find and Replace Text edits matches and Compare Lists finds what two lists share. Your text never leaves your browser.

Features

  • Plain text or regular expression patterns
  • Ignore capital letters
  • Whole words only
  • Invert to remove matching lines
  • Optional line numbers
  • Match count shown
  • Runs in your browser

Frequently asked questions

How do I filter the lines of a text that contain a word?

Paste your text, then type the word in the box. Only the lines that contain it are shown. Tick Ignore capital letters to match Apple and apple together, and tick Whole words only if you don't want the word to match inside longer words.

How do I remove lines that contain a word?

Type the word and tick Keep the lines that do NOT match. The result then contains every line except those with the word. It is a fast way to clean a list of unwanted entries.

What is a regular expression?

It is a pattern language for matching text. For example ^b finds lines starting with b, \d+ finds lines with a number and cat|dog finds lines with either word. Tick Pattern is a regular expression to use them. If the pattern is invalid, the tool tells you.

Does the plain search treat symbols specially?

No. When the regular expression option is off, characters such as dots, brackets and stars are matched exactly as typed, so a.b only matches those three characters in a row and not a, any letter, then b.

Can I see which lines matched?

Yes. Tick Show line numbers and each result line is prefixed with its original line number. The summary shows how many lines matched out of the total, even when you have inverted the filter.

Is there a size limit?

There's no fixed limit, but very large texts of many megabytes can slow your browser, and very complicated regular expressions can take a long time. For large files, use the grep command on your computer.

Related tools