Back to All Tools

JSON to BSON Converter

Convert JSON to BSON and BSON back to JSON. Display binary data as hex dump, upload .bson files, and download MongoDB binary format documents.

Input: 0 chars
Output: 0 chars
BSON Size: 0 bytes
JSON Keys: 0
Conversion: JSON → BSON

About JSON to BSON Converter

Our free online JSON to BSON Converter is a specialized utility that transforms JSON data into BSON (Binary JSON) format and vice versa. BSON is the binary-encoded serialization format used by MongoDB to store documents and for data exchange. It extends JSON with support for additional data types like Date, ObjectId, Binary Data, and various integer sizes.

The JSON to BSON conversion serializes JavaScript objects into the binary BSON format following the BSON specification. The output can be displayed as a hex dump (with address offsets, hex bytes, and ASCII representation), Base64 encoded string, or both formats simultaneously. This is useful for inspecting the binary structure of BSON documents, debugging MongoDB data, or preparing BSON data for API requests.

The BSON to JSON conversion parses binary BSON data and converts it back to human-readable JSON format. You can upload .bson files directly, paste hex dump or Base64 encoded BSON data, and the tool will parse and display the resulting JSON. The hex dump viewer shows address offsets, hex bytes with color-coded groups, and an ASCII representation column for easy binary data inspection.

All processing happens directly in your browser using the official MongoDB BSON library, so your data never leaves your device. This ensures complete privacy and security for your database documents, API payloads, and sensitive data.

Features

Bidirectional Conversion

Convert JSON to BSON and BSON back to JSON. Perfect for MongoDB debugging and data inspection workflows.

Hex Dump Display

View BSON binary data as formatted hex dump with address offsets, hex bytes, and ASCII representation.

BSON File Upload

Upload .bson or .bin binary files directly. The tool reads binary data and displays it as hex dump or Base64.

Multiple Display Modes

Choose between hex dump, Base64, or both formats. Customize bytes per row for hex display.

BSON Document Info

View BSON document size, element count, data types, and structure information.

Copy & Download

One-click copy to clipboard or download as JSON or binary BSON file.

Auto-Convert

Enable auto-convert mode to transform your data automatically as you type in real-time.

Statistics

View input/output character counts, BSON byte size, and JSON key count for quick data overview.

Privacy First

All conversion happens in your browser. Your data never leaves your device, ensuring complete security.

How to Use

1

Paste Your Data

Paste JSON or BSON data (hex dump or Base64) into the left input editor. Click "Sample JSON" or "Sample BSON" to load example data.

2

Configure Options

Set display mode (hex/Base64/both), hex bytes per row, JSON indentation, and whether to show type annotations.

3

Convert

Click "JSON to BSON" or "BSON to JSON" to perform the conversion. The result appears in the right output editor.

4

Copy or Download

Click Copy to copy the converted data to clipboard, or Download to save it as a file (.json or .bson).

Frequently Asked Questions

What is BSON?

BSON (Binary JSON) is a binary-encoded serialization format used by MongoDB to store documents. It extends JSON with support for additional data types including Date, ObjectId, Binary Data, 32-bit/64-bit integers, doubles, regular expressions, and more. BSON is designed to be efficient in storage, fast to parse, and easy to traverse. While JSON is human-readable, BSON is optimized for machine processing.

How is BSON data displayed?

BSON binary data can be displayed in three modes: (1) Hex Dump - shows address offsets, hex bytes organized in rows, and an ASCII representation column. (2) Base64 - a compact text encoding of the binary data. (3) Both - shows hex dump and Base64 together. The hex dump format is useful for inspecting the binary structure, while Base64 is useful for embedding BSON in text-based formats.

How do I input BSON data?

You can input BSON data in three ways: (1) Upload a .bson or .bin binary file using the "Upload BSON" button. (2) Paste a hex dump string (address offsets and hex bytes) into the input editor. (3) Paste a Base64 encoded string. The converter automatically detects the input format and parses the binary BSON data accordingly.

What BSON data types are supported?

This converter supports all standard BSON data types: String (UTF-8), Integer (32-bit and 64-bit), Double, Boolean, Date, ObjectId, Binary Data, Regular Expression, Timestamp, Null, Undefined, DBRef, MinKey, MaxKey, Decimal128, and JavaScript Code. Arrays and embedded documents (nested objects) are also fully supported.

How do I convert BSON from MongoDB?

To convert BSON data from MongoDB: (1) Export a document using `mongodump` or `mongoexport` in BSON format. (2) Copy the raw BSON bytes. (3) Upload the .bson file to this tool. (4) The tool will parse the BSON and display the JSON equivalent. Alternatively, if you have hex dump or Base64 encoded BSON, you can paste it directly into the input editor.

Is this JSON to BSON converter free?

Yes, it is completely free to use with no registration, sign-up, or limits. You can use it as many times as you need for personal, educational, or commercial projects without any restrictions.

Does it work offline?

Yes, once the page is loaded, all JSON and BSON conversion happens entirely in your browser using JavaScript. No server communication is needed, so you can use it even without an internet connection after the initial page load.

What is the BSON document size limit?

MongoDB has a BSON document size limit of 16 MB. This tool can handle documents up to that limit, though very large documents may take a few moments to parse and display. For typical debugging and inspection tasks, documents are usually much smaller and process almost instantly.

Is my data secure?

Absolutely. All JSON and BSON conversion happens directly in your browser using JavaScript. Your data is never sent to any server, stored, or logged. This ensures complete privacy and security for your database documents, API payloads, and sensitive data.