BSON Hex Viewer

Paste a one-field JSON object to see its BSON bytes in hex.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

BSON (Binary JSON) is the binary-encoded serialization format MongoDB uses to store documents and exchange them over its wire protocol — it extends JSON with extra types like dates and binary data, and every element in the byte stream follows the same layout: a one-byte type code, a null-terminated field-name string, and then the value encoded according to its type (e.g., a 32-bit little-endian integer, or a 4-byte length prefix followed by UTF-8 bytes for a string).

This viewer takes a small, single-field JSON document (one string or integer value) and encodes it exactly as MongoDB's driver would, then displays the resulting bytes as annotated hexadecimal — labeling the document length prefix, type byte, field name, and value bytes — so you can see how JSON's text representation maps onto BSON's compact binary layout without needing to run a database driver.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators