Export MongoDB & Firebase JSON to Excel
Last updated: 13 June 2026
Databases export JSON, but stakeholders want spreadsheets. The catch is that each database has its own export shape - MongoDB's extended JSON, Firebase's id-keyed objects, and line-delimited NDJSON dumps all look different. This guide shows a real example of each and exactly how it lands in Excel. It's free, needs no signup, and runs in your browser so your data stays private.
MongoDB exports (extended JSON)
mongoexport emits documents whose _id is wrapped as an extended-JSON object. With --jsonArray you get a single array like this:
[
{ "_id": { "$oid": "66b3f0a1c2e4a1b2c3d4e5f6" }, "sku": "A-100", "qty": 3 },
{ "_id": { "$oid": "66b3f0a1c2e4a1b2c3d4e5f7" }, "sku": "A-101", "qty": 7 }
]The $oid wrapper flattens into a single _id.$oid column holding the full ObjectId hex string, with sku and qty alongside it. A { "$date": "…" } field flattens the same way into a .$date column, kept verbatim with no timezone shift.
NDJSON dumps (one document per line)
Run mongoexport without --jsonArray and you get NDJSON - the same records, one compact JSON object per line, no surrounding brackets or commas:
{"_id":{"$oid":"66b3f0a1c2e4a1b2c3d4e5f6"},"sku":"A-100","qty":3}
{"_id":{"$oid":"66b3f0a1c2e4a1b2c3d4e5f7"},"sku":"A-101","qty":7}That converts to the same two-row sheet as the array above - the converter reads each line as its own record. Log-style tables and BSON dumps usually arrive in this format; the dedicated NDJSON & JSONL to Excel guide covers the format's edge cases.
Firebase / Firestore exports
Firebase data comes in two shapes that behave very differently:
// Shape A - keyed by document id (Realtime Database export)
{ "users": { "u1": { "name": "Ada" }, "u2": { "name": "Linus" } } }
// Shape B - a documents array (Firestore REST export)
{ "documents": [ { "name": "Ada" }, { "name": "Linus" } ] }- Shape A is one object, not a list, so it flattens to a single wide row (
users.u1.name,users.u2.name, …). To get one row per document, first turn it into an array withObject.values(export.users)and convert that. - Shape B uses
documents, a recognised record-list key, so each document becomes its own row automatically - no reshaping needed.
Nested sub-documents → columns
Database documents nest deeply. By default, nested objects flatten into dotted columns (profile.country), arrays of simple values become comma-separated cells, and arrays of sub-documents are kept as JSON text in one cell so each top-level document stays a single row. See nested JSON to Excel for how the deeper levels expand.
Large collections
Each file can be up to 15 MB. For exports over that, narrow the query (a date range or a projection of just the fields you need) before exporting, or split the collection into a few files and convert each. Filtering at the database keeps the spreadsheet fast and focused.
Frequently asked questions
- Can I drop mongoexport output in as-is?
- Yes. mongoexport without --jsonArray writes NDJSON (one document per line), and with --jsonArray it writes a single JSON array. Both are accepted directly - paste the text or upload the .json / .ndjson file and the converter detects the shape for you.
- What happens to MongoDB _id and other $-prefixed fields?
- Extended-JSON wrappers flatten into readable dotted columns: { "_id": { "$oid": "..." } } becomes an _id.$oid column, and a { "$date": "..." } value becomes a .$date column. The original ObjectId hex string is preserved exactly rather than rounded.
- How do I get one row per Firestore document?
- If your export is an object keyed by document id ({ "users": { "u1": {…} } }), that is a single object, so it flattens to one wide row. Convert it to an array first (Object.values(export.users) in JavaScript), then convert that array to get one row per document. A Firestore REST export shaped as { "documents": [ … ] } is already a record array, so each document becomes a row automatically.
- Are long numeric IDs from my database rounded?
- No. The converter parses numbers with a big-number-safe parser, so a 64-bit account number or a Twitter-style snowflake ID keeps every digit instead of losing precision or appearing in scientific notation.
- Is my database export uploaded anywhere?
- No. Conversion runs entirely in your browser, so a collection dump that may contain emails, tokens, or customer records never leaves your device and is never sent to a server.
Related guides
- JSON to Excel
- NDJSON / JSONL to Excel
- Nested JSON to Excel
- Postman JSON to Excel
- API Response to Excel
- JSON to CSV vs Excel
- JSON Array to Excel
- GST JSON to Excel
- Best JSON to Excel Converter
- How to Open JSON
- JSON to Google Sheets
See all guides or the FAQ.