You can convert MBOX to JSON by using a short Python script. Install Python then save the script from Method 1 below. After that keep your MBOX file in the same folder and run the script from your command line.
This step works for a small file. You will have to handle the code yourself. Also the script leaves attachments behind.
A reliable MBOX to JSON converter tool fixes both problems. You need no coding skills. Attachments travel along with the emails. Batches work too so you can convert MBOX files to JSON for many files at once. Full tool steps are further down.
An MBOX file stores many emails in one plain file. Only a few apps outside email programs can open it. On the other hand, JSON works almost everywhere. Because of this many users want to convert MBOX to JSON format. You will learn manual methods, their limitations and a professional tool approach in this blog. We will also guide you on which option is best for you.
Also Read: Convert MBOX to CSV
Why Users Need to Export MBOX Files Into JSON?
Most people who convert MBOX files to JSON usually want one of these setups:
- Simple Coding: Developers run JSON straight through scripts without extra cleanup steps.
- Direct Database Imports: Modern databases take JSON files directly. It keeps setup work light.
- Faster Data Sorting: Counting and filtering records is easy. Since every field has a clear label.
- Smooth System Transfers: Moving email records between tools works best when all data uses one simple shape.
- Instant Text Checks: Basic text tools open JSON files right away. It does not require heavy software.
Manual Ways to Convert MBOX to JSON
There are two free manual ways to convert MBOX files into JSON format. They both rely on Python. You can choose any of them that you find easier.
Before You Start
A little preparation saves you from a headache later.
- Make a Backup: Save an extra copy of your MBOX file in a safe location. Keep your original file completely untouched.
- Test Small First: Try the steps on a tiny file first. You can easily check errors this way.
- Close Mail Apps: Close any email program that is using this file. So it does not change midway.
- Keep Names Simple: Use short file names without weird symbols so your commands run smoothly.
#1: Run a Short Python Script
Python can read MBOX files out of the box. This simple script turns every email into a clean JSON entry containing the sender, subject, date and body text.
1. Download Python from its official website.
2. Copy the script below into a plain text file. Then name it “convert.py”.
import email.policy
import json
import mailbox
def read_email(file):
return email.message_from_binary_file(file, policy=email.policy.default)
inbox = mailbox.mbox("mail.mbox", factory=read_email)
emails = []
for message in inbox:
body = message.get_body(preferencelist=("plain", "html"))
emails.append({
"from": str(message.get("From", "")),
"to": str(message.get("To", "")),
"subject": str(message.get("Subject", "")),
"date": str(message.get("Date", "")),
"body": body.get_content() if body else "",
})
with open("mail.json", "w", encoding="utf-8") as out:
json.dump(emails, out, indent=2, ensure_ascii=False)
3. Drop “convert.py” in the same folder as your mbox file. It will help the script find it.
4. Rename your mbox file to mail.mbox. The script looks for that exact name.
5. Open your command line in that folder. Type python convert.py to convert MBOX to JSON.
6. Use python3 if Python shows an error. Large files may take longer.
7. Look for a new mail.json file in that same folder. Open it in any basic text editor.
8. Scan a few entries to verify that the text matches your original emails.
#2: Use a Free Command-Line Package
Outside developers built a small add-on that can convert MBOX into JSON format with one command. Once you install it, you can use it again and again.
Make sure Python is already installed on your computer. Because the add-on runs on it.
- Type pip install mbox-to-json in your command line. Then press Enter so the add-on installs.
- Run mbox-to-json mail.mbox in the folder that holds your file to convert mbox to json.
- Look for the new JSON file right next to your mbox file when the work ends.
- Add -o and a new file name to the command if you want to save the output somewhere else.
- Include -a when attachments matter to you because that option saves them as separate files.
- Use mbox-to-json -h any time you want to see every option the add-on offers.
Where Manual Ways Fall Short
Manual ways to convert MBOX to JSON come with a few headaches.
- Coding Skills: Coding skills matter here. A single tiny typo can stop the whole process.
- Attachment Issues: Attachments stay behind with the script. It needs an extra setting to save properly.
- Large MBOX Files: Large MBOX files can slow your computer down. The script loads everything at once.
- Filter Options: Extras like date filters or tracking progress force you to write even more code.
A dedicated MBOX to JSON converter tool handles all this extra stuff automatically.
Convert MBOX to JSON Using Professional Tool: Automated Approach
You can use the SysTools MBOX Converter Tool to convert MBOX to JSON in a few easy steps. You do not need to code while using this. This tool can convert MBOX files into JSON + multiple other formats, such as PST, MSG, EML, PDF, HTML, CSV, MHT, etc. It is compatible with Mac and Windows.
Download this tool and follow the five quick steps below
5 Easy Steps to Convert MBOX Files into JSON Format
1. Install and launch the tool.

2. Add a single MBOX file or the whole folder if you want to convert MBOX files in bulk.

3. Choose JSON as your save format.

4. Apply a date range or naming style if you want only some emails. Then choose a save folder.

5. Click the export button to convert MBOX to JSON.

Why Choose The Automated Approach?
- You can convert whole folders at once. This saves you time from doing the same steps again and again.
- This tool keeps all your email attachments safe. You never lose key files along the way.
- Custom date filters and naming options keep new files neat and easy to find.
- You can convert MBOX files into JSON including multiple other formats, such as PST, MSG, EML, PDF, HTML, CSV, MHT, etc.
- You do not need coding skills to use it.
- Offers 24/7 customer support for your queries.
- Fully compatible with all versions of Mac and Windows.
Final Note
You can convert MBOX to JSON using manual and automated both ways. Manual approach needs coding, more time and more work. If you have large files or lots of folders, this MBOX to JSON converter tool saves you time. Try the free script if you have just one small file. Use the tool when you have a lot of files to do. Make a safe copy of your original file first.
Frequently Asked Questions
Q. Can I turn an MBOX file into JSON for free?
Yes. Both free Python methods are free. They convert your MBOX files to JSON. You just need to watch out for small command errors along the way.
Q. Do attachments move into the JSON files?
The simple script leaves them behind. The command tool saves them if you add the -an option. A converter tool brings them along automatically.
Q. Can I convert many MBOX files at once?
Dedicated tools do this best. They handle whole folders at once. That lets you convert large folders without doing repetitive work.
Q. How do I open the JSON file afterward?
Open it in any basic text editor like Notepad. You can also drag the file into a web browser to view your data clearly.