BSON to JSON Converter

Read binary BSON and convert its document structure into JSON.

Input: Text (UTF-8) or original file bytesResult: Text

Text input

Examples

Read MongoDB's published hello-world BSON bytes

Explain where a BSON document stores its length, field type, name and value.

Input

98b1aac7cf39409f-hello-world.bson

22 bytes

Download

Expected answer

JSON
{
  "hello": "world"
}
A compact feature-flag record

Input

c7e64c406602db906d3750eb.bin

27 bytes

Download

Expected answer

JSON
{
  "compact": true,
  "schema": 0
}
A UTF-8 café label

Input

6c5ed3425926f675b5d966a5.bin

37 bytes

Download

Expected answer

JSON
{
  "name": "café",
  "city": "Paris"
}
A negative sensor reading

Input

af8f37cc0b5a143665729c3b.bin

36 bytes

Download

Expected answer

JSON
{
  "station": "demo",
  "celsius": -12
}
A decimal checkout amount

Input

aff43eb33be8bd7282620943.bin

39 bytes

Download

Expected answer

JSON
{
  "amount": 12.5,
  "currency": "EUR"
}
A missing avatar

Input

1678dc8706ba89779e91998e.bin

28 bytes

Download

Expected answer

JSON
{
  "user": "demo",
  "avatar": null
}
A nested configuration

Input

a011ceeb3fdd02377d0df2c8.bin

34 bytes

Download

Expected answer

JSON
{
  "server": {
    "port": 443,
    "tls": true
  }
}
basic

Input

98b1aac7cf39409f348c4d52.bin

22 bytes

Download

Expected answer

JSON
{
  "hello": "world"
}

Input data should be in a raw bytes format.

Format reference: BSON deserialise background and specification

Related tools

Browse code tidy tools