Loading BSON to CSV Converter...
Please wait a moment

How to Convert BSON to CSV - Step by Step Guide

Step 1

Input Your BSON Data

Let's convert your BSON data to CSV format! Whether you're exporting MongoDB collections to spreadsheets, analyzing database data in Excel, or preparing reports, you have several convenient options:

•
Paste directly: Copy your BSON data in Base64 or Hex format from MongoDB exports, mongodump, or binary data tools
•
Upload a file: Click "Upload" to pick a .bson or .bin file; a mongodump file with many documents gives one row per document
•
Try the sample: Click "Sample" to load three example MongoDB documents and see the conversion

Example: BSON Input (Base64)

Two MongoDB documents written back to back, as mongodump does, then Base64-encoded:

fAAAAAdfaWQAZzi256sSzTTvVniQAm5hbWUADgAAAFJvYmVydCBXaWxzb24AAmVtYWlsABMAAAByb2JlcnRAZXhhbXBsZS5jb20AEGFnZQAeAAAAAmRlcGFydG1lbnQADAAAAEVuZ2luZWVyaW5nAAhpc0FjdGl2ZQABAHUAAAAHX2lkAGc4tuerEs0071Z4kQJuYW1lAAsAAABKYW5lIFNtaXRoAAJlbWFpbAARAAAAamFuZUBleGFtcGxlLmNvbQAQYWdlABwAAAACZGVwYXJ0bWVudAAKAAAATWFya2V0aW5nAAhpc0FjdGl2ZQAAAA==
Step 2

Configure Conversion Options

Customize how your BSON data is converted to CSV format:

•
Input format: Select Base64 (compact) or Hex (debug-friendly) encoding for your BSON data
•
Include headers: Add column names as the first row for better spreadsheet compatibility
•
Flatten nested objects: Convert nested MongoDB documents to flat CSV columns (e.g., "address.city" becomes a column)
•
MongoDB types: The CSV updates about half a second after you stop typing. ObjectId becomes hex, Date becomes ISO 8601, Binary becomes Base64, and long integers and Decimal128 values keep every digit

Example: CSV Output

The same BSON, now converted to CSV format:

_id,name,email,age,department,isActive
6738b6e7ab12cd34ef567890,Robert Wilson,[email protected],30,Engineering,true
6738b6e7ab12cd34ef567891,Jane Smith,[email protected],28,Marketing,false
Step 3

Export Your CSV Data

Once the CSV looks right, take it with you:

•
Copy to clipboard: One-click copying of CSV data for quick pasting into Excel, Google Sheets, or other applications
•
Download as .csv: Save it as converted-bson.csv. The file starts with a UTF-8 byte order mark so Excel reads accents and emoji correctly
•
Quoting: values with commas, quotes, line breaks or edge spaces are quoted the RFC 4180 way, so spreadsheets and CSV parsers read them back unchanged

Frequently Asked Questions

How do I convert BSON to CSV from MongoDB?

Upload the .bson file that mongodump wrote, or paste the BSON bytes as Base64 or Hex. Each document becomes one row and every field becomes a column. Documents with different fields are fine: the columns are the union of all of them, and a document without a field just gets an empty cell.

What happens to nested MongoDB documents and arrays?

With "Flatten Nested Objects" on, a nested document turns into dotted columns such as address.city, and array items get their position, so tags: ["a", "b"] becomes tags.0 and tags.1. With it off, each nested value is written into its cell as compact JSON text instead.

How are MongoDB-specific types written?

ObjectId becomes its 24-character hex string, Date becomes ISO 8601 in UTC (2024-01-15T10:30:00.000Z), Binary and UUID become Base64, and Decimal128 keeps its exact digits, so 14.50 stays 14.50. Rarer types such as Timestamp or MinKey are written as canonical Extended JSON.

Will long numbers like 8901240544102066246 survive?

Yes. BSON int64 values are read as exact integers, so IDs such as 8901240544102066246 or -9223372036854775808 appear in the CSV with every digit, and text like 00501 keeps its leading zeros. Be careful when opening the file in Excel, though: Excel itself rounds numbers after 15 digits and drops leading zeros, so import those columns as text if you need them as they are.

What CSV format does the converter produce?

Comma-separated values with a header row (you can switch it off). A value is wrapped in double quotes when it holds a comma, a quote, a line break or leading or trailing spaces, and quotes inside are doubled, following RFC 4180. The downloaded file starts with a UTF-8 byte order mark so Excel shows accents and emoji correctly; copied text has no mark.

Is my data uploaded anywhere?

No. The BSON is decoded and turned into CSV in your browser, nothing you paste or upload is sent to our server, and a reload starts with an empty editor. Very large dumps are limited by your browser memory and can take a few seconds, so for a huge collection mongoexport --type=csv may be the better route.