How to Extract Emails and URLs from Large Text Files
Open the file in the Extract Emails or Extract URLs tool (or paste the text), and every address or link appears one per line with duplicates removed. Then sort it, lowercase it, filter it by domain, or join it with commas or semicolons.
Published · Updated
To extract emails from text, open Extract Emails, click Open file (or paste the text into the box) and copy the result: every address it finds is listed one per line, with repeats removed. Links work the same way in Extract URLs. Both tools search the whole text with a pattern, so it does not matter whether the addresses sit in a server log, a CSV export from a CRM, an email thread or the HTML source of a page. The sections below explain exactly what is matched, what is left out, and how to turn the raw result into a clean list.
Step by step: a list of emails from a large file
- Open Extract Emails. Click Open file and choose the file, or drag it onto the text box. Plain-text formats are accepted: .txt, .csv, .tsv, .log, .md, .json, .html, .xml, .srt and .vtt. Files over 20 MB are refused; split those first.
- Leave Remove duplicates on (it is on by default). Duplicates are compared ignoring upper and lower case, so
[email protected]and[email protected]count once, and the first spelling is kept. - Tick Lowercase if you want every address in one consistent form, and Sort A–Z if you want the list alphabetical.
- Type a domain in Only this domain to keep, for example, only your company’s addresses.
- Pick the output in One per: Line (for a spreadsheet column), Comma, or Semicolon (Outlook). Then press Copy or Download .txt.
For text over 200,000 characters the tool waits for a short pause in typing before it runs again, so editing a big file in the box stays responsive. Word documents and PDFs are not plain text: open them, select all, copy, and paste into the box.
What counts as an email address
The pattern is practical rather than the full email grammar. It looks for a local part (letters, digits and . _ % + -, with dots only between characters and an apostrophe allowed between two letters, as in o'brien), an @, and a domain made of labels with a top-level domain of at least two letters. Letters outside English are allowed, so josé@exämple.de is found. Trailing dots that end a sentence are dropped, and image file names such as [email protected] are skipped.
| Text in the file | Extracted |
|---|---|
"Lee, Anna" <[email protected]> |
[email protected] |
mailto:[email protected]?subject=Hi |
[email protected] |
please reply to [email protected]. |
[email protected] |
[email protected],[email protected] |
both addresses, separately |
name@localhost |
nothing (no top-level domain) |
[email protected] |
nothing (double dot) |
[email protected] |
nothing (IP address, not a domain) |
name [at] example [dot] com |
nothing (not decoded) |
o'[email protected] |
o'[email protected] |
One case needs a look before you trust the list. The HTML standard’s definition of a valid email address allows symbols such as ! # $ & * / = ? ^ { | } ~ before the @, but the tool only accepts the apostrophe. An address like [email protected] therefore comes out as [email protected]. Such addresses are rare, and those characters usually separate an address from what comes before it ([email protected]), so this is a deliberate trade-off. If your source may contain them, search it for these symbols directly before an address and fix those by hand. The Only this domain filter keeps an address when its domain is exactly what you type or a subdomain of it: example.com keeps mail.example.com but drops notexample.com. A leading @ in the field is ignored.
Extracting URLs and domains
Extract URLs finds links that start with http://, https://, ftp:// or www.. A bare example.com/pricing without either is not matched, because ordinary words with a dot would then become false links. Punctuation that ends a sentence (. , ; : ! ?) and an unmatched closing bracket are trimmed, while brackets that belong to the address are kept.
| Text in the file | Extracted |
|---|---|
See https://example.com/docs/start?ref=mail (updated). |
https://example.com/docs/start?ref=mail |
(https://en.wikipedia.org/wiki/Mercury_(planet)) |
https://en.wikipedia.org/wiki/Mercury_(planet) |
www.example.org/help. |
https://www.example.org/help |
<a href="https://example.com/page">x</a> |
https://example.com/page |
[link](https://example.com/x) |
https://example.com/x |
example.com/pricing |
nothing |
The options change the result like this:
| Option | Effect |
|---|---|
| Add https:// to www. links | www.example.org/help becomes https://www.example.org/help (on by default) |
| Domains only | Each link is reduced to its host name: https://docs.example.com/q3 becomes docs.example.com |
| Remove duplicates | Repeated links are listed once |
| Only this domain | Keeps links whose host is the domain you type or a subdomain of it (same rule as above; the path is not checked) |
Domains only keeps www. as part of the host, so www.example.com and example.com stay as two entries. Commas are legal inside URLs, so a comma ends a link only when another http://, https://, ftp:// or www. follows it directly: https://example.com/a,https://example.com/b gives two links. In a CSV row such as Name,https://a.com/x,Other the next field stays attached (https://a.com/x,Other). Put a space after commas first with Replace Text if your file has them. In HTML source, & inside a link is read as &; other entities are kept as written, so decode them with HTML Entities if your links contain them.
Duplicates, case and sorting
Both tools drop repeats ignoring case in the domain. For domains that is exactly right: RFC 5321 says mailbox domains follow DNS rules and are not case sensitive, and RFC 3986 says the scheme and host of a URL are case-insensitive. The part before the @ is different in theory. RFC 5321 says the local part “MUST BE treated as case sensitive”, though it adds that relying on this is discouraged. In practice mail systems treat Anna and anna as the same person, so merging them is the useful default, but Lowercase changes how the address is written, so leave it off if you need the original spelling.
The URL tool lowercases only the scheme and host when it compares links, and compares the rest as typed. Under RFC 3986 the path is case-sensitive, so https://example.com/A and https://example.com/a are kept as two links (they can be different pages), while HTTPS://EXAMPLE.COM/a counts as a repeat of https://example.com/a.
Some duplicates are not visible as text. Google’s Gmail help page explains that dots don’t matter in Gmail addresses: [email protected] and [email protected] reach the same inbox, though not for work or school accounts on their own domains. No extractor can know this for every provider, so the tool keeps them as two addresses.
If you already have a list, one address per line, and only need to clean it, use Remove Duplicate Lines. It shows which lines were repeated and how often, and Keep: Last occurrence keeps the newest entry when a list is in date order. For more sort orders than A–Z, pass the result to Sort Lines. The guide on removing duplicate lines compares the same job in Excel, Google Sheets and the command line.
A worked example
This is a short email thread with a link list, pasted as is:
From: "Lee, Anna" <[email protected]>
To: [email protected]; [email protected]
Hi team, please reply to [email protected].
Full notes: https://docs.example.com/q3/notes?id=42 (shared).
Old page: www.example.org/pricing, mirror ftp://files.example.net/q3.zip
Unsubscribe: mailto:[email protected]
Extract Emails with the default options gives four addresses; the status line reads “4 addresses (5 found)” because the second Anna is a duplicate:
[email protected]
[email protected]
[email protected]
[email protected]
With Lowercase, Sort A–Z and One per: Semicolon (Outlook) the same text gives one line ready for a To field:
[email protected]; [email protected]; [email protected]; [email protected]
Extract URLs gives three links. The mailto: address is not a web link and is left out:
https://docs.example.com/q3/notes?id=42
https://www.example.org/pricing
ftp://files.example.net/q3.zip
With Domains only the result is docs.example.com, www.example.org and files.example.net.
Before you use the list
- Check the edge cases. Search the source for symbols such as
!or=directly before an@, and scan a sorted list for typos and look-alike domains. - Check the count. The status line shows how many items are in the result; a number far from what you expected usually means a broken export (for example, a whole CSV row joined into one cell).
- Consider where the addresses came from. The FTC’s CAN-SPAM compliance guide lists “harvesting email addresses” among the practices that can carry criminal penalties, and notes the law makes no exception for business-to-business email. Extracting your own customers’ addresses from your own export is routine. Collecting addresses from other people’s web pages to send them marketing is not something this tool should be used for.
- Privacy. The text never leaves your browser, which matters for exports full of customer data. The guide on client-side text tools explains what that means in practice.
Questions
Can I extract emails from an Excel or CSV file?
Yes. Save the sheet as .csv and open it with the Open file button of Extract Emails, or copy the column and paste it. Commas, semicolons and quotes around cells end an address, so each one comes out separately.
Does it find addresses written as "name [at] example [dot] com"?
No. Obfuscated addresses are not decoded on purpose, because the guesses would produce wrong addresses. Fix them by hand or with Replace Text first.
Why does the result say "4 addresses (5 found)"?
The first number is what is in the result; the second is every match in the text. The difference is the duplicates that "Remove duplicates" dropped.
Is my file uploaded anywhere?
No. The file is read by your browser and the matching runs on your device; nothing is sent to a server.
Sources
- IETF, RFC 5321 Simple Mail Transfer Protocol, section 2.4, https://www.rfc-editor.org/rfc/rfc5321#section-2.4 (checked 2026-10-21)
- IETF, RFC 3986 Uniform Resource Identifier (URI): Generic Syntax, section 6.2.2.1, https://www.rfc-editor.org/rfc/rfc3986#section-6.2.2.1 (checked 2026-10-21)
- WHATWG, HTML Living Standard: valid email address, https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address (checked 2026-10-21)
- Google, Gmail Help: Dots don't matter in Gmail addresses, https://support.google.com/mail/answer/7436150 (checked 2026-10-21)
- Federal Trade Commission, CAN-SPAM Act: A Compliance Guide for Business, https://www.ftc.gov/business-guidance/resources/can-spam-act-compliance-guide-business (checked 2026-10-21)