Skip to content

Extract Email Addresses from Text β€” Free Tool

An email extractor finds and pulls all email addresses from any block of text. Paste your text below to extract, deduplicate, and copy all email addresses instantly.

Options

0 characters

What Is Email Extraction?

Email extraction scans a body of text and identifies all strings that match the format of a valid email address β€” a local part, an @ symbol, and a domain with at least one dot. The extracted addresses are collected into a deduplicated list ready for import into CRM, email platforms, or spreadsheets.

You would use email extraction when building contact lists from unstructured data, cleaning CRM imports that contain emails mixed with other text, parsing log files for user identifiers, extracting contacts from email threads, and auditing documents for PII (personally identifiable information).

Code Examples for Email Extraction

JavaScript

function extractEmails(text) {
  const regex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
  const matches = text.match(regex) || [];
  const seen = new Set();
  return matches.filter(email => {
    const lower = email.toLowerCase();
    if (seen.has(lower)) return false;
    seen.add(lower);
    return true;
  });
}

const text = "Contact: support@example.com, sales@example.com\n" +
  "Duplicate: SUPPORT@EXAMPLE.COM\n" +
  "Personal: alice.smith+work@gmail.com";

console.log(extractEmails(text));
// ['support@example.com', 'sales@example.com', 'alice.smith+work@gmail.com']

// Extract from HTML
const html = '<a href="mailto:contact@site.com">Email us</a> or bob@site.com';
console.log(extractEmails(html));
// ['contact@site.com', 'bob@site.com']

Python

import re
from collections import OrderedDict

def extract_emails(text):
    pattern = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
    matches = re.findall(pattern, text)
    seen = OrderedDict()
    for email in matches:
        lower = email.lower()
        if lower not in seen:
            seen[lower] = email
    return list(seen.values())

text = "alice@example.com, bob@example.com, ALICE@EXAMPLE.COM"
print(extract_emails(text))
# ['alice@example.com', 'bob@example.com']

# Extract from file and write to CSV
import csv
with open('document.txt', 'r') as f:
    emails = extract_emails(f.read())
with open('emails.csv', 'w', newline='') as f:
    csv.writer(f).writerows([['email']] + [[e] for e in emails])

Bash

# Extract emails from a file
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' document.txt | sort -uf

# Extract from multiple files
grep -roE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' /path/to/docs/ | \
  cut -d: -f2 | sort -uf

# Count unique emails
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' data.txt | sort -uf | wc -l

# Extract and save
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' input.txt | sort -uf > emails.txt

Common Email Extraction Mistakes

False positives with technical strings. File references like user@localhost, version strings like v2.0@release, and internal identifiers may match the email pattern but are not actual email addresses. Review extracted lists before sending to them.

Case normalization for deduplication. User@Example.COM and user@example.com are the same address, but string comparison treats them as different. Always lowercase before deduplicating. This tool handles that automatically.

Legal compliance is your responsibility. Extracting emails is a technical operation; using them for unsolicited communication may violate GDPR, CAN-SPAM, CASL, or other regulations. Only email contacts who have given explicit consent.

How to Extract Emails from Text Online

1. Paste your text into the input area. The tool accepts any text β€” emails, documents, web page content, CSV files, or raw data. Use the example button to see how it works.

2. Configure your options. Enable deduplication to remove duplicate addresses (case-insensitive). Enable sorting to get an alphabetical list.

3. Review the results. The tool shows all found email addresses with a count. Each email appears on its own line for easy reading.

4. Copy in your preferred format. Use β€œCopy (newline)” for one email per line, or β€œCopy (comma)” for a comma-separated list suitable for email clients, spreadsheets, or databases.

Why Extract Emails from Text?

Email addresses are scattered throughout documents, web pages, spreadsheets, and message threads. Manually picking them out is tedious and error-prone, especially when dealing with large volumes of text. An email extractor automates this process, finding every valid address in seconds and giving you a clean, deduplicated list ready for use.

Building contact lists: When you receive a document or spreadsheet with contact information mixed into free-form text, extracting emails manually means scanning every line. This tool pulls every address into a clean list, making it easy to import into your CRM, email client, or marketing platform.

Processing business communications: Long email threads, meeting notes, and project documents often contain email addresses scattered throughout the text. Extracting them lets you quickly build a distribution list for follow-ups or identify all stakeholders mentioned in a conversation.

Data cleanup and migration: When migrating data between systems, email addresses may be embedded in notes fields, comment columns, or unstructured text. Extracting them into a separate column ensures clean data migration and prevents addresses from being lost in free-text fields.

Research and auditing: Security researchers, compliance teams, and data auditors often need to identify all email addresses in a dataset. The deduplication and sorting features make it easy to get a definitive list of unique addresses for review or reporting.

This tool processes everything locally in your browser. No data is uploaded, no emails are stored or transmitted, and no account is required. Paste, extract, copy, done.

Frequently Asked Questions About Extract Emails

How do I extract email addresses from text?

Paste any text containing email addresses into the input area. The tool uses a regular expression to find all valid email addresses and displays them as a clean list. You can copy the results as a newline-separated or comma-separated list.

Does the tool deduplicate email addresses?

Yes. The deduplicate option is enabled by default and uses case-insensitive matching. If 'user@example.com' and 'USER@EXAMPLE.COM' both appear in your text, only the first occurrence is kept.

Can I sort the extracted emails alphabetically?

Yes. Toggle the 'Sort alphabetically' option to sort all extracted emails in A-Z order. Sorting is case-insensitive, so 'alice@example.com' comes before 'Bob@example.com'.

What email formats are supported?

The tool recognizes standard email formats including addresses with dots, hyphens, underscores, and plus signs in the local part (before the @). It supports all common domain extensions including multi-part TLDs like .co.uk.

Can I copy emails as a comma-separated list?

Yes. Two copy buttons are provided: 'Copy (newline)' gives you one email per line, and 'Copy (comma)' gives you a comma-separated list. The comma format is useful for pasting into email CC/BCC fields or spreadsheets.

Is my text processed securely?

Yes. All processing happens entirely in your browser using JavaScript. Your text is never sent to any server. No emails are stored, logged, or transmitted β€” making it safe for confidential documents and sensitive data.

Does the tool extract emails from HTML?

Yes. Paste raw HTML and the tool finds email addresses in both visible text and href attributes (mailto: links). It extracts email addresses regardless of where they appear in the markup.

Is this tool GDPR compliant?

The tool runs entirely in your browser β€” no data is transmitted or stored. However, how you use extracted emails must comply with GDPR, CAN-SPAM, and other regulations. Only email contacts who have given consent.

Related Free Online Tools

Extract emails here, then use our other tools for additional text processing.

Extract Email Addresses from Text β€” Free Tool | FlipMyCase