Online grep: search text in multiple files

This online grep searches a whole folder of text files, or files you pick, for a word or a regular expression. Each match shows its file path, line and column, with the lines around it. Everything runs in your browser, and you can download the results as a text or JSON report.

Your files stay on this device.

Choose your files

Select a folder or specific files to search.

Drop a folder or files hereOr use the buttons below. Files in subfolders are searched too.

No files selected.

Folder selection depends on your browser and device. Choose files works as a fallback.

Search settings

Enter starts the search. Shift+Enter adds a line break.

UTF-8 or BOM-marked UTF-16 text. Binary files and unreadable encodings are skipped with a reason. PDF, Office and archive contents are not extracted.

Search results

Choose files and run a search to see matches here.

Your matches will appear here

Each result includes its file path, line location and surrounding text.

How to search text in multiple files

  1. Choose a folder or files

    Select Choose folder to include subfolders, select Choose files for specific files, or drop them on the dashed box.

  2. Set the text or pattern

    Type in Search for. Pick Literal text or Regular expression, then set Match case and Context lines.

  3. Review and save the matches

    Select Search files and check File coverage. Text report and JSON report save every match, including other result pages.

Choose files and set the search

Select Choose folder and pick a folder. The browser hands the page every file in it, subfolders included, with each file's relative path. Choose files picks single files instead, and it is the only picker in a browser that cannot choose folders. You can also drop a folder or files on the dashed box. A line under the buttons counts the files and their total size.

Choose files may show only filenames. If two files share a name, their selection numbers, such as file 1 and file 2, distinguish them in the results and reports.

Type a word or phrase in Search for. Literal text is selected to start with, so dots, brackets and other symbols match only themselves. Match case is on by default; clear it to find Invoice and INVOICE too. Context lines sets how many lines before and after each match are shown, 2 to start with.

Select Search files. The results show 30 matches per page, grouped by file, with each match highlighted.

Example: find invoice in three files

Load example selects three sample files, example/notes/todo.txt, example/logs/events.log and example/config/settings.json, and fills in the word invoice. Select Search files and the summary reads 4 matches in 2 files.

In todo.txt the matches are on line 2 at column 6, in Send invoice to client, and on line 4 at column 7, in Check invoice status. In events.log both matches start at column 1, on lines 2 and 4. The file settings.json is searched and has no match.

Keep Match case on and search for INVOICE, and nothing is found. Clear Match case and the same 4 matches come back. Set Context lines to 0 to see only the matching lines.

Now choose Regular expression and enter invoice (sent|status). It matches 2 places: Check invoice status in todo.txt, starting at column 7, and invoice sent in events.log.

Regular expressions and line numbers

Regular expression mode uses JavaScript syntax, typed without / delimiters. Unicode matching and finding every match are always on, and clearing Match case makes the pattern ignore case. Two more options then appear, ^ and $ match each line and Dot matches line breaks. An invalid pattern shows an error, and no file is searched.

Line and column numbers start at 1. Columns count UTF-16 code units, so an emoji before a match takes two columns. A Windows CRLF counts as one line break. A lone CR, Unicode line separator or Unicode paragraph separator also starts a new line. End locations in reports are exclusive: they point just after the matched text.

The pattern sees the whole file with its line endings intact, so a match can run across lines, and \r?\n finds a line break in Windows and Unix files alike. Matches do not overlap: searching aaaa for aa gives 2 matches, not 3.

Empty matches are included. The │ marker shows their position. After each empty match, the search advances by one Unicode code point before looking for the next match.

Which files it can search

The tool reads plain text in UTF-8, with or without a byte order mark, and UTF-16 with a byte order mark. File names and extensions do not matter. Source code, log files, JSON, CSV and files with no extension are all searched when their bytes are text.

A file is skipped, with its reason, when its bytes are not valid text in those encodings, such as a Windows-1252 file with an accented letter. A file that holds binary or control data is skipped too. PDF, Word, Excel and ZIP files are skipped this way, because their text sits inside a binary or compressed container. Export them to plain text first.

Open File coverage under the results to see every file marked searched, skipped or unsearched. Each searched file shows its match count, its encoding and its number of lines, and each skipped file shows why.

Limits

The tool only searches. It does not replace text, edit or rename files, or search file names. It takes files, not pasted text: to grep a snippet, save it as a .txt file first, or select Load example to try the controls.

There is no fixed cap on file size, file count or matches. Each file is read whole into memory, so a file too large for the browser is skipped with a reason, and the browser may leave out files it cannot access. A complex regular expression can run for a long time on a large file.

Cancel stops the search at once. Results from files that finished stay, and the rest are marked unsearched. Text report and JSON report download every match with its context lines, so they hold excerpts of your files. Check a report before you share it.

Questions

How can I search for text in all files in a folder?

Select Choose folder and pick the folder. Every file the browser supplies, including files in subfolders, is searched, and each result shows its relative path, such as notes/todo.txt. Enter the text in Search for and select Search files. If your browser cannot pick folders, select Choose files and pick several files at once.

Why was one of my files not searched?

The File coverage list gives a reason for every skipped file. The usual causes are an encoding other than UTF-8 or BOM-marked UTF-16, binary data such as a PDF or Word file, or a file the browser could not read. A file marked unsearched was still waiting when the search was cancelled or stopped.

Is this the same as the grep command?

It does the core of grep -n with context lines: it finds literal text or a regular expression and shows line numbers and the lines around each match. It uses JavaScript regular expressions instead of grep's syntax and has no command-line flags. It searches files you choose, not pasted text, and never changes them.

Can I search with a regular expression?

Yes. Choose Regular expression and type a JavaScript pattern without slashes, such as invoice (sent|status), or \d{4}-\d{2}-\d{2} for dates like 2026-09-24. Match case, ^ and $ match each line, and Dot matches line breaks change how the pattern matches. An invalid pattern shows an error and nothing is searched.

Are my files uploaded?

No. The files are read and searched by a worker in your browser, and the tool does not upload or store them. Paths, search text and results stay in the page's memory until you select Clear, choose new files or leave the page. A report is saved only when you select Text report or JSON report.