JSON to BSON Converter

Convert standard JSON to MongoDB extended JSON (BSON) format. Numbers become $numberInt/$numberDouble, dates become $date.

Converted BSON will appear here...

What Is JSON to BSON Converter?

This tool converts standard JSON into MongoDB's extended JSON format (commonly called BSON representation). Numbers are wrapped in $numberInt or $numberDouble, ISO date strings become $date with $numberLong timestamps, and ObjectId strings become $oid.

How to Use

  1. Paste your standard JSON into the input field.
  2. Click "Convert to BSON" to transform it.
  3. Use the output in MongoDB queries, scripts, or migrations.

Frequently Asked Questions

What formats does it recognize for dates?

ISO 8601 date strings (e.g., "2024-01-15T00:00:00.000Z") and numeric timestamps are detected and converted to $date format.

Can I convert BSON back to standard JSON?

Yes, toggle the direction or use the BSON to JSON converter.

Related Tools