᠎᠎᠎          
51K

JSON to BSON Converter

World's simplest json tool
Free online JSON to BSON converter. Just load your JSON in the input field and it will automatically get converted to BSON. In the tool options, you can set the extension of the downloaded file. By default, it is ".bson" but you can replace it with a custom one. Created for developers by developers from team Browserling.
We created a cloud browser! Browserling
Check out our project Browserling – anonymous cloud browser.
BSON Extension
File extension (when downloading).

What is a JSON to BSON Converter?

learn more about this tool
This tool converts JSON (JavaScript Object Notation) to BSON (Binary JSON). JSON and BSON are data formats used to exchange information between applications. JSON is a human-readable text format that is popular in web development, APIs, and modern databases. However, when transferring large amounts of data, JSON can be very inefficient because of the large amount of whitespace indentation characters that need to be transmitted, as well as curly braces and other syntactic JSON characters. BSON, on the other hand, is a binary representation of JSON data, making it much more compact and efficient for storing and transmitting data. Converting JSON to BSON significantly reduces the amount of data transmitted and speeds up its parsing. Once you load your JSON file in the input area, you'll see a hex dump of the BSON file in the output area. Click the "Save as" button to download the binary file. By default, the output BSON file has the ".bson" extension but you can change it to another in the options. Other common BSON extensions are ".bjson" and ".bin". If you need to convert a machine-readable BSON file back to a human-readable JSON file, you can use our Convert BSON to JSON tool. Json-abulous!

JSON to BSON Converter examples

Click to use
Convert JSON to Binary JSON
In this example, we convert a simple JSON object with two key-value pairs ("substance": "water" and "formula": "H2O") into a binary representation using the BSON format (Binary JSON). The output BSON is printed as hexadecimal bytes in the output and can be downloaded as a binary file with the extension ".bson" via the "Save As" button.
{ "substance": "water", "formula": "H2O" }
0x2b 0x00 0x00 0x00 0x02 0x73 0x75 0x62 0x73 0x74 0x61 0x6e 0x63 0x65 0x00 0x06 0x00 0x00 0x00 0x77 0x61 0x74 0x65 0x72 0x00 0x02 0x66 0x6f 0x72 0x6d 0x75 0x6c 0x61 0x00 0x04 0x00 0x00 0x00 0x48 0x32 0x4f 0x00 0x00
Required options
These options will be used automatically if you select this example.
File extension (when downloading).
Convert a JSON Array to a BSON Array
In this example, we convert a JSON array containing three types of coffee beans into binary BSON format. After the conversion, we change the BSON file extension to a custom one ".bin", which is well-suited for use with MongoDB databases.
["Arabica", "Robusta", "Liberica"]
0x33 0x00 0x00 0x00 0x02 0x30 0x00 0x08 0x00 0x00 0x00 0x41 0x72 0x61 0x62 0x69 0x63 0x61 0x00 0x02 0x31 0x00 0x08 0x00 0x00 0x00 0x52 0x6f 0x62 0x75 0x73 0x74 0x61 0x00 0x02 0x32 0x00 0x09 0x00 0x00 0x00 0x4c 0x69 0x62 0x65 0x72 0x69 0x63 0x61 0x00 0x00
Required options
These options will be used automatically if you select this example.
File extension (when downloading).
Convert Nested JSON Objects to BJSON
In this example, we load a more complex JSON object containing nested structures. As you can see, in the textual representation of JSON, larger and more complex objects can lead to inefficiencies as they contain a lot of whitespace characters that are used for indentation. However, converting such data to the BJSON format significantly reduces the size as the whitespace characters are omitted. The output data is represented as hex bytes but the binary file itself has the extension ".bjson".
{ "browsers": [ "internet explorer", "edge", "firefox", "safari", "opera", "chrome" ], "versions": [ 6, 7, 8, 9, 10 ] }
0xa3 0x00 0x00 0x00 0x04 0x62 0x72 0x6f 0x77 0x73 0x65 0x72 0x73 0x00 0x62 0x00 0x00 0x00 0x02 0x30 0x00 0x12 0x00 0x00 0x00 0x69 0x6e 0x74 0x65 0x72 0x6e 0x65 0x74 0x20 0x65 0x78 0x70 0x6c 0x6f 0x72 0x65 0x72 0x00 0x02 0x31 0x00 0x05 0x00 0x00 0x00 0x65 0x64 0x67 0x65 0x00 0x02 0x32 0x00 0x08 0x00 0x00 0x00 0x66 0x69 0x72 0x65 0x66 0x6f 0x78 0x00 0x02 0x33 0x00 0x07 0x00 0x00 0x00 0x73 0x61 0x66 0x61 0x72 0x69 0x00 0x02 0x34 0x00 0x06 0x00 0x00 0x00 0x6f 0x70 0x65 0x72 0x61 0x00 0x02 0x35 0x00 0x07 0x00 0x00 0x00 0x63 0x68 0x72 0x6f 0x6d 0x65 0x00 0x00 0x04 0x76 0x65 0x72 0x73 0x69 0x6f 0x6e 0x73 0x00 0x28 0x00 0x00 0x00 0x10 0x30 0x00 0x06 0x00 0x00 0x00 0x10 0x31 0x00 0x07 0x00 0x00 0x00 0x10 0x32 0x00 0x08 0x00 0x00 0x00 0x10 0x33 0x00 0x09 0x00 0x00 0x00 0x10 0x34 0x00 0x0a 0x00 0x00 0x00 0x00 0x00
Required options
These options will be used automatically if you select this example.
File extension (when downloading).
Pro tips Master online json tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinejsontools.com/convert-json-to-bson?input=%7B%0A%20%20%22substance%22%3A%20%22water%22%2C%0A%20%20%22formula%22%3A%20%22H2O%22%0A%7D&extension=.bson
All json tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly color-code the syntax of a JSON file.
Quickly beautify a JSON data structure.
Quickly compress a JSON file.
Quickly convert JavaScript data to a JSON string.
Quickly convert a JSON string to JavaScript data.
Quickly check JSON for errors and report them.
Quickly escape special JSON characters.
Quickly unescape an escaped JSON string.
Quickly convert a JSON data structure to an XML file.
Quickly convert an XML file to a JSON data structure.
Quickly convert a JSON data structure to a YAML markup.
Quickly convert a YAML markup to a JSON data structure.
Quickly convert a JSON file to a TSV file.
Quickly convert TSV data to a JSON file.
Quickly convert a JSON file to a CSV file.
Quickly convert CSV data to JSON data.
Quickly convert a JSON structure to binary JSON encoding.
Quickly convert JSON to a PNG, GIF, JPG, or BMP image.
Quickly encode JSON to base64.
Quickly decode base64 to JSON.
Quickly convert JSON to URL-encoding.
Quickly convert URL-escaped JSON back to JSON.
Quickly convert JSON data to plain text.
Quickly edit a JSON file in a neat JSON editor in your web browser.
Coming soon These json tools are on the way
Display JSON Statistics
Display detailed information about a JSON data structure.
Flatten JSON
Extract all values or keys from a JSON object as a flat list.
Extract JSON Keys
Extract all keys from all key-value JSON pairs.
Extract JSON Values
Extract all values from all key-value JSON pairs.
Find JSON Keys/Values
Find keys and/or values that interest you in a JSON file.
Obfuscate JSON
Obfuscate a JSON data structure.
Censor JSON Data
Remove certain information from a JSON data structure.
Hide JSON Strings
Rewrite JSON strings using escape codes and make it hard to read.
Convert JSON to a Screenshot
Create a screenshot from JSON code.
Convert JSON to a List
Create a text list from a JSON array or object.
Convert a List to JSON
Create a JSON array from a text list.
Convert JSON to Form Data
Generate HTTP form data from a JSON object.
Convert Form Data to JSON
Generate JSON object from HTTP form data.
Convert JSON to HTML
Create a HTML table from keys and values of a JSON object.
Convert JSON to Properties
Convert a JSON file to properties file.
Convert Properties to JSON
Convert properties data to JSON data.
Convert JSON to CSON
Convert a JSON file to a CSON file.
Convert CSON to JSON
Convert a CSON file to a JSON file.
Convert JSON to TOML
Convert a JSON config to a TOML config.
Convert TOML to JSON
Convert a TOML file to a JSON file.
Convert JSON to Bencode
Convert a JSON data structure to Bencode encoding.
Convert Bencode to JSON
Convert Bencode data to JSON data.
Convert JSON to JSONL
Convert a JSON file to a JSONL file.
Convert JSONL to JSON
Convert a JSONL file to a JSON file.
Convert JSON to BSON
Convert a JSON data structure to binary BSON data.
Convert BSON to JSON
Convert binary JSON data structure (BSON) to JSON.
Convert JSON to UBJSON
Convert a JSON file to a universal binary JSON (UBJSON).
Convert UBJSON to JSON
Convert universal binary JSON (UBJSON) to regular JSON.
Convert JSON to Message Pack
Serialize JSON data to binary MessagePack format.
Convert Message Pack to JSON
Unserialize binary MessagePack to a JSON struct.
Convert JSON to Protobuf
Serialize JSON data to binary Protobuf format.
Convert Protobuf to JSON
Unserialize binary Protobuf to a JSON struct.
Convert JSON to a LaTeX Table
Generate a LaTeX table from a JSON object.
Convert JSON to INI
Convert a JSON data file to an INI configuration file.
Convert INI to JSON
Convert an INI configuration file to JSON data file.
Truncate JSON
Loop over JSON structure and truncate all values or keys.
Find JSON Depth
Find the nesting depth of a JSON data structure.
Convert JSON to a Data URI
Convert a JSON data structure to a data URL.
Convert JSON to a PHP Array
Create a PHP data structure from a JSON data structure.
Convert a PHP array to JSON
Create a JSON data structure from a PHP data structure.
Compare Two JSON Files
Diff JSON files and show differences visually.
Sort JSON Object Keys
Lexicographically sort the order of JSON object keys.
Swap JSON Keys with Values
Exchange keys with values in a JSON file.
Create a Random JSON Array
Create a JSON array with random values.
Create a Random JSON Object
Create a JSON object with random keys and values.
Randomize a JSON Array
Randomly change the positions of array elements.
Randomize a JSON Object
Randomly change the order of key, value pairs.
Add Spacing to JSON
Add random spaces and newlines in a JSON file.
Tokenize JSON
Tokenize a JSON data structure.
Remove JSON Syntax
Remove all JSON syntax and leave just the values.
Change JSON Syntax
Change curly braces, commas, and quotes to other symbols.
Fix Quotes in JSON
Fix incorrectly quoted (usually single quote) keys and values.
Use Single Quotes in JSON
Make all keys and values in a JSON to be single-quoted.
Use Double Quotes in JSON
Make all keys and values in a JSON to be double-quoted.
Generate FakeSON
Create JSON that looks real but is fake (FakeSON).
Run jq
Execute a jq query on a JSON data structure.
Filter JSON
Filter keys and values that match a pattern.
Split a String into a JSON Array
Create a JSON array from a string.
Group a JSON Array
Create groups of JSON array items.
Merge JSON Arrays
Merge two or more JSON arrays together.
Compare JSON Arrays
Find differences in two or more JSON arrays.
Merge JSON Objects
Merge two or more JSON objects together.
Damage JSON
Introduce errors in a JSON data structure.
Fix JSON
Try to fix a damaged JSON to the best of our ability.
Create JSON Art
Convert images to valid JSON strings that look like ASCII art.
Visualize a JSON Structure
Create an abstract visualization of JSON's complexity.