CSV to BSON Converter - Convert CSV to MongoDB BSON Online
Convert CSV data to BSON (Binary JSON) format online for free.
How to Convert CSV to BSON - Step by Step Guide
Input Your CSV Data
Let's convert your CSV data to BSON format! Whether you're preparing spreadsheet data for MongoDB imports, working with database exports, or optimizing storage, you have several convenient options:
Example: CSV Input
Here's a typical CSV structure ready for BSON conversion:
id,name,email,age,department,isActive 1,Robert Wilson,[email protected],30,Engineering,true 2,Jane Smith,[email protected],28,Marketing,true 3,Mike Johnson,[email protected],35,Sales,false
Configure Parsing Options
Customize how your CSV is parsed and converted to BSON binary data:
Example: BSON Output (Base64)
The same CSV, now encoded as BSON in Base64 format:
VgAAAAJkb2N1bWVudHMABQAAAAACAAAAAmRvY3VtZW50cwADAAAAAAJpZAAEAAAAAQJuYW1lAA8AAABSb2JlcnQgV2lsc29uAAJlbWFpbAAUAAAAcm9iZXJ0QGV4YW1wbGUuY29tAARhZ2UAIAAAABAEZGVwYXJ0bWVudAAKAAAARW5naW5lZXJpbmcACWlzQWN0aXZlAAEAAA==
Export Your BSON Data
Get your encoded BSON ready for MongoDB! Multiple export options make integration seamless:
Frequently Asked Questions
How do I convert CSV to BSON for MongoDB?
Simply paste your CSV data into the converter, configure parsing options (headers, delimiter), choose your preferred output format (Base64 or Hex), and the tool automatically converts CSV to JSON first, then encodes it to BSON. Whole numbers become int32 or int64, decimals become doubles, true/false become booleans and empty cells become null. Anything the conversion would change, such as a zip code like 00501, 14.50 or a date, is kept as a string.
What's the difference between Base64 and Hex output?
Both represent the same BSON binary data as text. Base64 is more compact and commonly used for APIs and web transmission. Hex is easier to debug byte-by-byte and useful for development and troubleshooting.
How do I import the BSON into MongoDB?
Set Layout to "One document per row", download the .bson file and run mongorestore on it. That is the same layout mongodump writes, so each CSV row lands as its own document. The default layout wraps all rows in one { documents: [...] } document, which is easier to decode in code before inserting the rows with a MongoDB driver.
Does the converter support different CSV delimiters?
Yes! The converter supports comma, semicolon, tab, and pipe delimiters. You can also handle quoted fields containing delimiter characters. Quoted fields may contain line breaks too, and files saved by Excel (with a BOM or in Windows-1252) open correctly. The delimiter isn't guessed, so pick the one your file uses.
Can I convert large CSV files to BSON?
Yes. Everything runs in your browser, so the file never leaves your machine. A single BSON document tops out at 16 MB, though, so for big files set Layout to "One document per row" and only each row has to fit under that limit.
Is this CSV to BSON converter free?
Yes, completely free with unlimited conversions. No registration required, and you can convert as much CSV to BSON as needed. All processing happens locally in your browser for security and privacy.