Kadben

BSON to JSON converter

Choose a .bson file or paste BSON as Base64 or hex to read it as JSON, with every BSON type shown.

Runs in your browser. Nothing you paste or choose is uploaded.

BSON to JSON

    Add a step
    Result

      How to use it

      1. Choose a .bson file, or paste the BSON as Base64 or hex.
      2. Read the JSON; a file with several documents gives an array.
      3. “Reverse the direction” turns JSON into BSON.

      Rules and limits

      How BSON is read and written

      Limits

      Questions and answers

      How are MongoDB types written?

      As in MongoDB Extended JSON: {"$oid": …} for ObjectId, {"$date": …} for dates, {"$numberDecimal": …}, {"$binary": …}, {"$timestamp": …}. 64-bit integers beyond 2^53 are written as {"$numberLong": …} so that no digit is lost.

      Can it read a mongodump file?

      Yes: the documents of a .bson file come one after another, and the result is an array of them. Very large dumps can be slow in a browser.

      What if the data is cut off?

      BSON begins with the length of each document, so a missing end is found at once and the message names the byte. Copy the whole value, for example the full hex dump.

      Related tools