Email addresses end up buried in all kinds of places: a long email thread with dozens of people copied in, a CRM export where the address sits inside a notes field, a signup sheet pasted from a document, or the HTML source of your own organisation's staff directory. Picking them out by eye is slow and error-prone, especially when the same person appears several times with different capitalisation.
This guide explains how email extraction works, what makes a valid-looking address, the trade-offs of pattern matching, and how to get a clean, de-duplicated list in a browser, a spreadsheet or with a regular expression. It also covers what you should and should not do with the list afterwards.
What an email address looks like to a program
An email address has two parts separated by @:
- The local part, before the
@. It can contain letters, digits and characters such as.,_,%,+and-. - The domain, after the
@. It is made of labels separated by dots, ending in a top-level domain of at least two letters, such as.com,.ioor.co.uk.
The formal standards allow more exotic forms, such as quoted local parts with spaces, but those are almost never seen in practice. Extraction tools therefore use a practical pattern that matches the addresses people actually use. A simplified version looks like this:
[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2,}
This finds addresses inside surrounding text, angle brackets, mailto: links and CSV cells, while ignoring things like @handle or user@localhost that have no proper domain.
Plus addressing and case
Many providers support plus addressing: j.smith+newsletter@example.org delivers to j.smith@example.org. Extraction keeps the full address, because the tag may be meaningful to the owner.
The domain part is case-insensitive. The local part is technically allowed to be case-sensitive, but in practice nearly all mail systems treat it as case-insensitive, so lowercasing addresses is the standard way to avoid duplicates such as Sarah.Jones@ and sarah.jones@.
Extract emails in your browser
Our Email Extractor runs on your device, which matters because address lists are personal data.
- Open Email Extractor and paste your source into Text containing email addresses. It can be plain text, HTML source, CSV or a chat log. The Sample shows mixed cases, angle brackets, a
mailto:link and some near misses. - Choose an Output format: One per line, Comma + space, Comma, Semicolon, Tab or Space.
- To keep only certain domains, type them in Only domains containing, for example
example.comor.edu. Separate several with commas. - To drop domains, use Exclude domains containing, for example your own company domain when you only want external contacts.
- Keep Remove duplicates (case-insensitive) and Lowercase on for a clean list. Turn on Sort A → Z if you want alphabetical order.
- Check the summary, which shows how many addresses were found, how many are in the result and how many distinct domains there are. Then Copy or Download.
Stray dots at the end of an address, from sentences like "write to info@example.com.", are removed automatically.
Other ways to extract emails
Spreadsheets
If the addresses are in a spreadsheet column and each cell contains only one address among other text, Google Sheets can extract it with a regular expression:
=REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")
Newer versions of Excel 365 have also added regex functions, but availability depends on your version, so check whether REGEXEXTRACT exists in yours. For cells containing several addresses, a tool that returns all matches is easier. Afterwards, the Remove duplicates feature in either app cleans the column.
Text editors and command line
Editors with regex search, such as VS Code or Notepad++, can find all matches, though collecting them into a list takes some effort. On macOS and Linux, grep does it in one line:
grep -Eoi '[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}' file.txt | sort -fu
-o prints only the matches and sort -fu removes duplicates case-insensitively. This is the best route for large files or repeated jobs.
Your email client
For addresses in your own mailbox, your email client or provider may be able to export contacts directly, which is cleaner than scraping message text.
Tips, pitfalls and responsibilities
Pattern matching finds shapes, not real inboxes
A valid-looking address may not exist, may be misspelled or may be a role address such as noreply@. Extraction cannot confirm deliverability. Review the list, and remove obvious placeholders like name@domain examples.
Obfuscated addresses are skipped
Addresses written as info [at] example [dot] com are deliberately hard to harvest and will not match. Replace the words with symbols first using Find and Replace if you have a legitimate reason to include them.
Respect consent and the law
Having someone's address does not mean you have permission to email them. Many countries have data-protection and anti-spam rules that require consent or a legitimate relationship before sending marketing messages. Only use extracted addresses for purposes the people concerned would expect, and check the rules that apply to you.
Merging lists from several sources
Paste all the sources together and let Remove duplicates do the work. For combining with other data, the Comma Separator converts the output into whatever delimiter your import tool expects, and Remove Duplicate Lines helps when merging with an existing file.
Need phone numbers or links too?
The same source often contains other contact details. The Phone Number Extractor and URL Extractor work the same way.
Frequently asked questions
How do I extract email addresses from a block of text?
Paste the text into an email extractor, which uses a pattern to find every address, then remove duplicates and copy the list. On the command line, grep -Eo with an email pattern does the same.
How do I remove duplicate email addresses?
Lowercase all addresses and remove exact duplicates. Our extractor does both by default, so Sarah.Jones@Example.com and sarah.jones@example.com count once.
Can I extract only addresses from one domain?
Yes. Type the domain in Only domains containing, for example example.com. Use Exclude domains containing to remove domains instead.
Can I get the emails as a comma-separated list?
Yes. Choose Comma + space, Comma or Semicolon under Output format to paste straight into an email client's recipient field or an import form.
Is it legal to email addresses I extracted?
That depends on where you and the recipients are and on your relationship with them. Many jurisdictions require consent for marketing emails, so check the applicable rules before sending.