Convert BSON to JSON Online

Convert MongoDB BSON hex dumps to readable JSON in your browser. Free, offline, client-side - full BSON spec support, secure.

Convert MongoDB BSON hex dumps into readable pretty-printed JSON. Runs entirely in your browser — full BSON spec support with little-endian parsing.

How to Use Convert BSON to JSON Online

  1. Grab the BSON hex. Export it from MongoDB, bsondump, or a driver's raw output. The hex string represents the full binary document, starting with its 4-byte little-endian length header.
  2. Paste it in the input. The 0x prefix is optional and whitespace between bytes is stripped automatically, so both 0x05 00 00 00 00 and 0500000000 work.
  3. Click Convert. Or press Ctrl+Enter (Cmd+Enter on Mac). The tool validates the hex, then parses the BSON document according to the spec: little-endian Int32/Int64, null-terminated C-strings, nested documents and arrays.
  4. Inspect the stats. Below the output you'll see "42 bytes · 3 top-level fields · depth 2" so you can quickly verify the parse matches your expectations.
  5. Read the JSON. Output is pretty-printed with 2-space indentation. Arrays come through as real JSON arrays (BSON encodes them as documents with numeric keys - we reconstruct the array).
  6. Copy or download. "Copy JSON" puts the text on your clipboard. "Download .json" saves converted.json. Both buttons enable only after a successful conversion.
  7. Debug errors explicitly. If something fails, the error toast tells you exactly what: "Unsupported BSON type 0xff at offset 18", "Document length 42 doesn't match actual bytes 30", or "Truncated String value".

Frequently Asked Questions

Is my data secure?

Yes. All parsing happens 100% client-side in your browser. Your BSON data is never sent to any server or stored anywhere.

What is BSON?

BSON is “Binary JSON” – the binary format MongoDB uses internally to store documents. It encodes the same data model as JSON but in a compact byte layout with explicit types (Int32 vs Int64, Date, Binary, etc.) and faster traversal.

Is this tool free?

Yes, this BSON to JSON converter is completely free with no limits on document size, usage, or registration.

Which BSON types are supported?

Double (0x01), UTF-8 String (0x02), Embedded document (0x03), Array (0x04), Boolean (0x08), Null (0x0A), UTC Datetime (0x09), Timestamp (0x11), Int32 (0x10), and Int64 (0x12). ObjectId, Binary, Regex, and a few rarer types are not yet supported – they raise a specific error.

Does it handle nested documents and arrays?

Yes. Embedded documents are parsed recursively. BSON arrays – which are actually documents with numeric keys – are reconstructed into real JSON arrays in the output.

Why are my Int32 values wrong on old browsers?

This tool uses `DataView.getInt32(offset, true)` for little-endian parsing, supported in every browser from the last decade. If you see wrong values, double-check your hex is actually LE and you haven’t transposed bytes.

What happens to very large Int64 values?

Int64 values that fit within JavaScript’s safe integer range (±2⁵³-1) come through as regular numbers. Values outside that range are rendered as BigInt strings to preserve precision – JSON.stringify outputs them as quoted strings.

Does it work offline?

Yes. Once the page loads, parsing runs locally in your browser with no network calls. Bookmark the page and use it on an air-gapped machine if you’re working with sensitive data.

How do I get BSON hex out of MongoDB?

Use bsondump --type=debug on a BSON file, or in the mongo shell call db.coll.findOne().toBSON().toString('hex') in a driver. The MongoDB Compass export feature also emits hex dumps for individual documents.

What are the common error messages?

“Invalid hex characters” (input has non-hex chars), “Hex string must have even length” (odd byte count), “Document length X doesn’t match actual bytes Y” (header lies about size), “Unsupported BSON type 0x…” (type not yet implemented), and “Truncated …” (data ends mid-element).