BSON Decoder
Turn BSON back into something you can read. Drop in a .bson or .bin file or paste a hex or base64 dump and see the decoded document as JSON, plus a compact breakdown that counts the elements by type. The tool reads the BSON element system end to end: the little-endian document length, null-terminated element names, and values of type double, string, embedded document, array, binary, ObjectId, boolean, datetime, null, regex, JavaScript code, code-with-scope, int32, timestamp, int64, decimal128, and the min and max keys. It decodes nested documents and arrays recursively with a capped depth and prints ObjectIds and datetimes in readable forms. The tool flags a truncated document or element, a non-terminated name, an unsupported type byte, and trailing bytes. Everything runs on-device.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Drop a file here, or browse
Accepts: .bson,.bin,application/octet-stream,application/bson
Files stay on your device.
Ctrl+V to paste an image
Text is processed on this device. If a file is selected, the file is used instead.
Options
Drop a file above to begin
Your file are processed on this device and never uploaded.
How it works
What BSON is
BSON is the binary document format MongoDB uses on the wire and on disk. A document starts with a little-endian byte length, then repeats a type byte, a null-terminated element name and a value, and closes with a zero byte. The decoder reads that layout directly, so a .bson dump or a copied hex or base64 payload becomes a readable JSON document without a database or a driver.
The types it understands
The decoder covers the full common type set: doubles, strings, embedded documents and arrays, binary data with its subtype, ObjectIds, booleans, UTC datetimes, nulls, regular expressions, JavaScript code and code-with-scope, int32, timestamps, int64, decimal128, and the min and max key sentinels. Documents and arrays are decoded recursively with a depth cap, and ObjectIds and datetimes are printed in readable hexadecimal and ISO forms.
A type breakdown alongside the JSON
The second view counts the elements by type. That is useful when a document looks wrong: a count of zero int64 values tells you a field was written as an int32, and a missing binary entry explains why an attachment is absent. Because BSON is length-prefixed throughout, the decoder can validate each element and continue instead of failing at the first odd byte.
Warnings worth reading
The decoder flags a document length that does not match its bytes, a truncated value, an element name that is not null-terminated, an unsupported type byte and trailing bytes after the top-level document. Those warnings usually distinguish a genuinely corrupt export from a file that was decoded with the wrong byte order. Input is capped at 16 MB, with depth and element limits to keep a hostile file from hanging the tab.
Questions
Can I paste a BSON dump instead of uploading a file?
Yes. The tool accepts a file or pasted text in hexadecimal or base64, and detects which encoding you used. Base64 output from mongodump and hex copied from a debugger both work.
Does it need a MongoDB connection?
No. The decode is entirely local. There is no server, no driver and no network request; the bytes you supply are the only input.
How are ObjectIds and dates shown?
ObjectIds are printed as 24-character hex strings and datetimes as ISO 8601 timestamps, which is easier to compare than the raw 12-byte and 8-byte values stored in the document.
What is the largest document it will decode?
16 MB, which matches the BSON document limit MongoDB itself enforces. Very deeply nested documents are stopped by a recursion cap rather than crashing the page.
Related tools
See categoryCBOR Decoder
Decode CBOR into readable JSON, with a structure outline and tag interpretation.
MessagePack Decoder
Decode a MessagePack binary message on-device into readable JSON with a type breakdown of every value.
Protobuf Decoder
Decode a Protocol Buffers binary message on-device into readable JSON with a per-field type breakdown.
JSON Formatter & Validator
Pretty-print, minify, recursively sort keys or validate JSON, with line/column errors.