How to Extract Data from Email Attachments (PDF, CSV & Excel)
Last updated August 2026
Try it now: extract email data to Excel, CSV, or JSON
Connect a mailbox to pull .eml/.msg in bulk, or paste a raw email to test the converter now.
Create a free account to download. No credit card required.
Pull the data out of the message itself
MailParse reads the email body and any HTML tables into named fields and lists every attachment by name. For the data inside a PDF or spreadsheet file, pair it with a document extraction tool. Try the email parser or read the methods below first.
Last updated July 2026
Most "extract data from email" problems are really two problems wearing one coat. Sometimes the value you need is in the message itself, the amounts in an HTML table, the order number in the body text. Sometimes it is locked inside a PDF invoice or an Excel report stapled to the message. Those are different jobs that need different tools, and the fastest way to waste an afternoon is to expect one tool to do both. This guide draws the line clearly, then walks the manual and automated routes for each side.
How do I extract data from email attachments?
To extract data from email attachments, separate the two tasks. An email parser reads the message: it pulls named fields out of the body and turns HTML tables into rows, and it lists each attachment by filename, type, and size. Reading the data inside the attached file itself, a PDF invoice or an Excel report, is a document extraction job, handled by a tool built to open that format. Do the email parsing to catch anything in the message, then run the files that hold the rest through a document extractor.
The reason this trips people up is that they are different problems. Separating attachments from a message is a mail task. Reading numbers out of a PDF is a document-parsing task. A tool like MailParse does the first well: it reads the message and its tables and tells you exactly which files came attached. It does not open the contents of those files, which is why the file side needs its own step.
Is the data in the email body or the attachment?
Check this first, because it decides which tool you need. Open a sample email and find the value you actually want. If it is typed in the body or sits in an HTML table in the message, an email parser reads it directly and no attachment step is required. If it is only printed inside an attached PDF or spreadsheet, the email parser will capture the message and note the file, but the number itself has to come from a document extractor pointed at that file. Many "attachment" jobs turn out to have the key fields in the body once you look.
How do I extract data from a PDF email attachment?
A PDF attachment needs a document extraction tool, not an email parser. A PDF has no rows and columns underneath, just text positioned on a page, so reading it means a tool that interprets the text layer, works out which numbers are amounts and which are quantities, and maps them to fields. An email parser does not reach inside the PDF, and Excel cannot open one as a table. Save the PDF, or have your workflow hand it off, then run it through a PDF to Excel converter that turns the file into structured rows.
Invoices and receipts are the common case, and they are templated, so a document extractor learns where the invoice number and total live and reads every future invoice from that sender the same way. Pair that output with the fields your email parser pulled from the message, and you have the whole record.
How do I parse a CSV or Excel attachment?
CSV and Excel attachments already hold rows and columns, so they are easier, but the work is rarely "just open the file." Real attachments carry junk header rows, merged cells, totals stuck at the bottom, inconsistent date formats, and column orders that shift between senders. Handling them means a spreadsheet tool or import step that maps each new file to the columns you care about, no matter how the source arranged it. As with PDFs, this is a file job: the email parser tells you the CSV arrived and captures anything in the message, and the spreadsheet import reshapes the file itself.
How do I save attachments from Outlook in bulk?
Outlook can save attachments in bulk through a VBA macro that loops over messages in a folder and writes each file to disk, and Power Automate can do the same with a cloud flow. Both get the files out, but neither reads the data inside them, so you end up with a folder of 300 PDFs and the real work still ahead. Saving attachments is the easy part; turning 300 saved PDFs into 300 clean rows is a separate document extraction step. We cover the Outlook message side in our guide to extracting data from Outlook emails.
Can Power Automate extract data from email attachments?
Power Automate can detect an incoming email, save its attachments, and write rows to a table, and with the paid AI Builder add-on it can read fields out of standard documents like invoices. For simple, consistent attachments inside a Microsoft 365 shop, that can be enough. The limits show up with varied layouts, scanned PDFs, and tables that span pages, where the built-in actions flatten or miss data and the document-reading capability sits behind a separate license. We compare the approaches in how to parse an email body in Power Automate.
How do I handle attachments across many emails in bulk?
Process at the mailbox or file-batch level rather than one message at a time. Connect the inbox or feed in a batch of .eml or .msg files, and an email parser walks every message, captures the body and table fields, and lists the attachments on each one into a single output. For the attached files themselves, route them to a document extractor in the same pass. With an email parser API you can pipe the message data through at scale and push the structured results straight to a database or accounting system through a webhook, then merge in the document extraction results for the files.
Putting it together
The honest decision tree is short. First, find where the value lives. If it is in the message body or an HTML table, an email parser reads it directly. If it is inside an attached PDF or spreadsheet, add a document extraction step for that file and combine the two results. If those attachments are invoices specifically, our guide to extracting invoice data from email goes deeper on the AP workflow, including importing the result into QuickBooks, Xero, or NetSuite.
The question that should drive the choice is how many times the same emails keep arriving. If the answer is "every week, forever," automate the message side and hand the files to a document tool. Drop an email into the parser to see the body and table fields it pulls, then decide what the attachments still need.