Email to JSON: Convert Email and Email Body Data into Structured JSON
Turn a message, its body, and its HTML tables into clean, predictable JSON without writing a parser
Raw email is awkward to work with in code: MIME parts, base64 attachments, HTML bodies, and a dozen header formats sit between the message and the fields you actually want. MailParse converts email to JSON for you. Connect a mailbox or paste a message, name the fields you need, and get a clean JSON object with the sender, subject, body, headers, and any custom values pulled from the body and HTML tables. Paste a sample below to see the JSON it produces.
Last updated August 2026
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.
To convert email to JSON, MailParse decodes the MIME parts, normalizes encodings to UTF-8, and returns one predictable object per message: sender, recipients, subject, date, plain text and HTML bodies, headers, and an array of attachments with filename, type, and size. You also name custom fields, such as order_number or invoice_total, that it reads out of the body and HTML tables.
- JSON
- Clean object per email
- Body
- Custom fields from the text
- Tables
- HTML rows into arrays
- Bulk
- One message or thousands
Plenty of work starts as an email and needs to end up as a record in software: a lead from a contact form, an order confirmation from a marketplace, an invoice from a supplier, an alert from a monitoring tool. JSON is the format that travels everywhere in between, into a database row, a REST request, a queue, or a frontend. The problem is getting from a raw message to clean JSON. A real email is a tree of MIME parts with text and HTML versions of the body, base64-encoded attachments, inline images, forwarded chains, and headers in formats that vary by sender. Writing the parser yourself means handling all of that and re-testing it every time a sender changes their layout.
MailParse converts email to JSON so you do not have to. Paste a sample message, connect a Gmail, Outlook, Microsoft 365, or IMAP mailbox, or forward mail to a parsing address, and each message comes back as a predictable JSON object: sender, recipients, subject, plain text and HTML bodies, the full headers, and an array of attachments with their metadata. On top of those standard fields you name the custom values you want, such as order_id, invoice_total, or tracking_number, and the parser finds them in the body and returns them as typed fields, not raw text. You download the JSON, or pipe it straight to your app through the API and a webhook. This page covers what email JSON looks like, how to convert a single message or a whole inbox, and where a parser saves you from writing MIME code. If you would rather see the whole flow written out with sample payloads, the guide to converting email to JSON walks through it step by step, and the SendGrid Inbound Parse webhook and Amazon SES inbound parsing write-ups cover the two routes developers most often compare this against.
What the email to JSON converter does
Everything you need to turn a raw message into JSON your code can read.
Email to a predictable JSON object
Every message becomes the same shape: sender, recipients, subject, text and HTML bodies, headers, and attachments. You map the JSON to your code once instead of handling a different structure for every email.
Custom fields pulled from the body
Name values like order_id, invoice_total, or po_number and the parser extracts them from the message body and returns them as typed JSON fields, so your app reads order_id, not a wall of text.
HTML tables become arrays
Order confirmations and reports often carry their data in an HTML table. MailParse reads the rows and returns them as a JSON array of objects, one per line, instead of a flattened blob of text.
Attachments listed in the JSON
Every attachment arrives in the payload with its filename, content type, and size, so your code knows exactly what came in and can route it onward. MailParse does not open the file, so when the values you need are printed inside a PDF or spreadsheet, extract that document separately and merge the result with the parsed email JSON.
Convert one message or a whole inbox
Paste a single email to see its JSON, or connect a mailbox and convert a backlog of thousands in one pass. The JSON keeps the same field names whether you parse one message or a queue.
JSON, CSV, or Excel from the same parse
Need a spreadsheet instead? The same parsed result exports to CSV and Excel as well as JSON, so a developer and an analyst can each take the format they want from one upload.
How to convert email to JSON
Four steps from a raw message to a clean JSON object.
Add your email
Paste a sample message, upload an EML or MSG file, or connect a Gmail, Outlook, Microsoft 365, or IMAP mailbox so messages flow in automatically.
Name the fields you want
Keep the standard fields and add custom ones to pull from the body and HTML tables, so the JSON keys match what your application expects.
Get the JSON
MailParse decodes the MIME parts, normalizes encodings to UTF-8, reads the body and HTML tables, records each attachment by filename, and returns a clean JSON object per message.
Download or send it onward
Download the JSON, or have the API POST it to your webhook so each parsed email lands in your database, CRM, or queue in real time.
Who converts email to JSON
Developers and teams that need email turned into structured data their systems can read.
Developers feeding an app or API
Convert inbound email into JSON your code can consume without writing MIME parsing, so a contact-form lead or an order email becomes a typed object you insert or forward in a few lines.
Data and analytics pipelines
Turn a stream of emails into JSON records and load them into a warehouse or pipeline, so reporting runs on structured fields instead of a mailbox full of messages.
Low-code and automation builders
Get clean JSON to drop into Zapier, Make, or Power Automate instead of slicing the body with split and substring expressions that break when a sender changes the layout.
Order, invoice, and lead capture
Pull order IDs, invoice totals, tracking numbers, and contact details out of the body and HTML tables as JSON fields, ready to create a record per email automatically.
Why convert email to JSON with MailParse instead of by hand
No MIME parsing to write
Skip walking the MIME tree, decoding base64, and reconciling text and HTML bodies. MailParse hands you a clean JSON object with the parts already separated.
Body data, not just headers
A raw RFC-822 parse gives you fixed headers. MailParse also extracts the custom values you name from the body and returns them as typed JSON fields.
Attachments and tables included
Encoded attachments and HTML tables come through decoded and structured in the JSON, instead of being left as base64 strings or flattened text.
Holds up when senders change format
Hand-written parsers key on text positions and break on a reorder. MailParse keeps returning the named fields when the layout drifts, so the JSON shape stays stable.
Ways to convert email to JSON, compared
Getting from a raw message to clean JSON has a few honest paths, depending on how much code you want to own. Here is how they line up on the choices a developer actually makes, with credit to each where it leads. To send that JSON to your app over a webhook, see the email parser API.
| What matters | MailParse | Write a MIME parser | Raw .eml to JSON converter | Low-code expressions (Zapier/Make) |
|---|---|---|---|---|
| What it does | Returns a clean JSON object with named body fields, tables, and attachments | Your code walks the MIME tree and builds the JSON | A tool dumps the raw message structure to JSON | You slice the body with split and substring steps to build JSON |
| Body field extraction | Name order_id or invoice_total and get it back as a typed key | You write the extraction for every field and sender | Headers and raw body only, no business fields | Brittle text slicing that breaks when the layout shifts |
| HTML tables | Read into a JSON array, one object per row | You parse the HTML table yourself | Left as an HTML string | Hard, usually left as text |
| Attachments | Decoded from base64 with metadata, contents read for PDF and CSV | You decode and handle each file format | Often a base64 string you decode later | Limited, usually just a file link |
| Setup | Paste a message or connect a mailbox, no code | Build and maintain the parser and its tests | Paste one file, no batch or automation | Build the flow and maintain each expression |
| Best for | Clean, stable JSON for an app without writing a parser | Teams that need full control and data kept on their servers | A quick look at one message's structure | A simple, low-volume automation you already run |
Capabilities reflect each approach as of June 2026. Library and connector features change, so verify current support before you build. No pricing is implied here.
Frequently asked questions
How do I convert an email to JSON?
Paste the message, upload an EML or MSG file, or connect a mailbox in MailParse, then name the fields you want. The parser decodes the MIME parts, reads the body and HTML tables, lists each attachment by filename and type, and returns a clean JSON object with the sender, subject, body, headers, and your custom fields. You download the JSON or have the API POST it to your webhook, with no MIME parsing to write yourself.
What does an email in JSON format look like?
Email JSON is an object with predictable keys: from, to, subject, date, a text body, an HTML body, an array of headers, and an array of attachments with filename, type, and size. With MailParse you also add custom fields, so an order email might include order_id and total as typed values alongside the standard fields, which is what your application reads instead of raw text.
How do I convert an email body to JSON?
Name the values you want pulled from the body, such as order_id, invoice_total, or tracking_number, and MailParse finds them in the text and returns them as JSON fields. HTML tables in the body come back as a JSON array, one object per row, so the data in the message becomes structured keys rather than a single flattened string.
How do I convert an Outlook or MSG email to JSON?
Upload the MSG file or connect your Outlook or Microsoft 365 mailbox, and MailParse parses the message the same way it handles any email, returning sender, subject, body, headers, and attachments as JSON. You do not need Outlook installed or a script, and a backlog of saved MSG files can be converted in one pass.
Can I convert email attachments to JSON?
Yes. MailParse extracts each attachment and includes it in the JSON with its filename, content type, and size, so your code knows what arrived. It does not read the data inside a PDF or spreadsheet attachment; for that, send the file to a document extraction tool and merge the result with the parsed email JSON.
How do I convert email to JSON automatically?
Connect a Gmail, Outlook, Microsoft 365, or IMAP mailbox, and MailParse checks for new mail every 15 minutes and converts each new message to JSON automatically, so new email becomes a structured record in your system without anyone exporting a file.
Can I convert many emails to JSON at once?
Connect a mailbox and MailParse keeps converting new mail to JSON as it lands, on the same field structure every time, so it is safe to load straight into a database or pipeline. For an existing backlog, upload individual files or paste raw email text to convert them one at a time.
Is there a free email to JSON converter?
You can create a free account to paste a message and see the JSON shape before you build against it. Paid plans add higher monthly volume, connected mailbox sync, and team access.
Convert your email to JSON now
Paste a message or connect a mailbox and see the body, tables, and attachments come back as clean, structured JSON.