Processed in your browser

CSV / BSON Converter

Wraps CSV records in an explicit rows document before BSON encoding and requires the same structure when decoding. This protects table boundaries while preserving BSON-specific values through Extended JSON markers.

Processed in your browser
0 / 1,500,000
Converted output

Tool guide

What is CSV / BSON Converter?

CSV and BSON Converter places tabular records in MongoDB's binary document format. Encoding wraps rows in an explicit rows document and decoding requires the same contract, preserving table boundaries instead of guessing. ObjectId, dates, and long integers use Extended JSON markers in the intermediate representation rather than unsafe JavaScript numbers. Review the result against the driver version and collection schema. Common workflows include the following. Generate MongoDB driver fixtures. Inspect tabular records in BSON logs. Review dedicated BSON value mappings. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.

When to use it

  • Generate MongoDB driver fixtures.
  • Inspect tabular records in BSON logs.
  • Review dedicated BSON value mappings.

How to use it

  1. Choose the delimiter.
  2. Use unique CSV headers.
  3. Paste complete BSON Base64 for decoding.
  4. Review Extended JSON and string typing.
  5. Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.
  6. Review the output, status message, and documented limits; copy, download, or continue only after the result matches your expectation.

Runnable examples

The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.

Example 1

id,name,status
64,CSV BSON,ready
65,CSV Plist,planned

Example 2

SAAAAARyb3dzAD0AAAADMAA1AAAAAmlkAAMAAAA2NAACbmFtZQAJAAAAQ1NWIEJTT04AAnN0YXR1cwAGAAAAcmVhZHkAAAAA

Input rules

  • CSV headers must be unique.
  • BSON must contain one rows array.
  • Unsafe values are rejected.
  • Text input is counted before processing and is limited to 1,500,000 characters on this page; file modes apply the separate file limit shown in the workspace.
  • BSON binary is represented as Base64.

Output rules

  • BSON bytes use Base64.
  • Dedicated types remain marker objects.
  • CSV fields are exported as text.
  • Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
  • Decoded BSON must contain one rows array.

Limitations and cautions

  • BSON binary is represented as Base64.
  • Decoded BSON must contain one rows array.
  • BSON-specific values need destination review.

How your data is handled

All parsing, conversion, Base64 work, and intermediate data remain in the current browser tab. JSONLane does not upload the input or retain it after refresh or close.

FAQ

Is CSV or BSON data uploaded?

No. Parsing, conversion, and output generation stay in the current browser tab.

Is every round trip lossless?

No. Table typing, comments, layout, and binary-specific values differ between formats and must be reviewed.

Why does the converter reject some valid documents?

The source may be valid but still lack a safe, unambiguous representation in the selected destination.

Why does BSON use rows?

A fixed rows array preserves the table boundary explicitly.

Can long integers lose precision?

Dedicated values use Extended JSON markers.

Can Base64 go directly into a database?

Usually the original BSON bytes must be restored first.

Updated: 2026-08-12