Convert JSON5 to BSON

Turn JSON5 files into BSON. One BSON document with the same keys in order; a top-level list is wrapped under the key items and any other value under value.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop JSON5 files on the dialor turn it to pick what to do

JSON5 turned into one BSON document.Keys keep their order, and values keep their types.

  1. What you get

    One BSON file holding a single document. The keys appear in the same order as in the JSON5.

    Integers, floats, booleans, null, text, nested objects and lists keep their types. JSON5 numbers become plain numbers.

  2. Values that are not objects

    A top-level list is wrapped under the key items. Any other top-level value is wrapped under the key value. Either way, the result is one document.

  3. What changes

    Comments are dropped. Dates stay text, so a date written as a string is stored as a string and not as a BSON date.

    Integers beyond the signed 64-bit range become floats.

  4. Going back

    To turn a BSON file into JSON5, use BSON to JSON5. For other formats, see every BSON conversion.

JSON5 and BSON.What each format is.

The formats

From · JSON5

JSON5

JSON with comments, trailing commas and unquoted keys.

Extensions
.json5
MIME type
application/json5
Kind
Text and data
To · BSON

BSON

MongoDB's binary document encoding, JSON with dates and binary fields.

Extensions
.bson
MIME type
application/bson
Kind
Text and data

In your code.The same JSON5 to BSON conversion through the API, for your app or your agent.

terminal
$ cv convert report.json5 report.bson
$ cv convert report.json5 report.bson

Questions.What people ask about JSON5 to BSON.

01OF 04

Yes. The BSON document has the same keys in the same order.

It is wrapped under the key items, so the file is still one document.

No. Dates stay text.

Comments are dropped. They do not appear in the BSON file.

More conversions.Other ways in and out of JSON5 and BSON.