HomeAll toolsBinary Format Decoder

Binary Format Decoder

Decode MessagePack, CBOR and BSON in your browser with exact byte spans, binary and extension types, 64-bit integers, item streams, diagnostics and JSON export.

Data is processed only in your browser
MessagePack, CBOR and BSON are decoded locally; inputs and files are never uploaded or added to the address bar automatically. “Share link” copies a link containing the original input, so use it only for non-sensitive data. Auto-detection lists every format that fully parses the bytes and never pretends an ambiguous result is unique.
116 B · 1 items · 10 nodes
Encoded bytes
DetectionBSON · 116/116 B
AmbiguousMultiple formats fully consume the input: MessagePack, BSON. Showing BSON.
Item overview
Item #1 typed JSONdocument · [0, 116)
BSON
{
  "$document": [
    [
      "name",
      "DevKit"
    ],
    [
      "active",
      true
    ],
    [
      "score",
      21.5
    ],
    [
      "tags",
      [
        "0",
        "mqtt",
        "1",
        "binary"
      ]
    ],
    [
      "blob",
      {
        "$binary": "AP8QIA==",
        "subtype": 0
      }
    ]
  ]
}

Binary, 64-bit integers, maps, extensions, CBOR tags and BSON special types use explicit wrappers so no type or precision is silently lost. This JSON is for inspection, not re-encoding.

Decoded tree · exact byte ranges
document#15 fields
stringnameDevKit
booleanactivetrue
doublescore21.5
arraytags4 items
string00
string1mqtt
string21
string3binary
binaryblob4 B · subtype 0 (generic) 00ff1020
Byte map · hover or click either side
000074000000026e616d6500070000004465t····name·····De
0010764b6974000861637469766500010173vKit··active···s
0020636f7265000000000000803540047461core·······5@·ta
003067730031000000023000020000003000gs·1····0·····0·
0040023100050000006d7174740002320002·1·····mqtt··2··
005000000031000233000700000062696e61···1··3·····bina
00607279000005626c6f6200040000000000ry···blob·······
0070ff102000·· ·

How to use

Binary Format Decoder reads MessagePack, CBOR and BSON in one page, with no schema required. It restores integers, floats, strings, binary values, arrays, maps, nested documents, extensions and each format's special types into a decoded tree. Every node keeps its exact [start, end) byte range; hover or click either pane and the matching bytes or node highlight in sync.

How to use: paste hex or Base64, or upload a binary file up to 2 MB. Auto mode tries all three formats and lists every candidate that consumes the whole input; it never guesses away ambiguity. Pin MessagePack, CBOR or BSON manually when you know the format. Consecutive MessagePack objects, CBOR Sequence items and BSON documents appear in an item overview. Select one to copy its typed JSON or download the exact original bytes.

What each format restores

FormatStructureSpecial values
MessagePackInteger widths, float32 / float64, str, bin, Array and MapExtension type ids, Timestamp extension, full uint64 / int64
CBORAll major types, definite and indefinite containers, chunked strings and tagsRFC 3339 time tags, Bignum tags, Simple Values and float16
BSONOrdered documents, nested documents, arrays, strings and binary subtypesObjectId, Decimal128, Timestamp, Regex, Code w/ scope, MinKey and MaxKey

Auto-detection and ambiguity

Auto mode does not decide from the first byte alone: it parses the entire buffer as each format. Only an error-free parse that consumes every byte is marked complete. If several formats fit, the page says so and shows every candidate. Hex 01, for example, is both a MessagePack and a CBOR positive integer. BSON length and terminator structure, CBOR tags and indefinite encodings, and MessagePack extensions raise a candidate's priority without hiding other complete matches.

Typed JSON and precision

JavaScript Number cannot represent every 64-bit integer, and plain JSON cannot directly carry binary data, maps, extensions or special BSON values. The report therefore uses explicit wrappers: large integers stay decimal strings, binary uses Base64, maps use key/value arrays, extensions retain their type id, CBOR tags retain their tag number, and BSON special types have their own markers. NaN and Infinity use a $float wrapper. This JSON is for inspection and archiving, not re-encoding.

Item streams, errors and limits

MessagePack can concatenate objects, CBOR Sequence can concatenate data items, and BSON can concatenate complete documents. The overview lists each boundary. When a BSON element is malformed but the declared document length is reliable, the tool keeps fields decoded before the break and continues with later documents. MessagePack and CBOR stop at the error when no reliable next boundary exists instead of guessing.

Input is limited to 2 MB, 20,000 items, 50,000 tree nodes and 256 nesting levels. The item list, tree and hex map are paginated. Reaching a limit is reported as a partial decode. Duplicate map keys produce warnings; invalid UTF-8, reserved type bytes, truncated lengths, unknown BSON element types and bad terminators produce errors. Every diagnostic jumps to its bytes.

Privacy and boundaries

Inputs, files and results stay in the current browser's memory and are never uploaded or added to the address bar automatically. Only “Share link” copies a link containing the original content (up to 6,000 bytes); do not use it for sensitive data. The tool checks binary wire structure, not business schemas, signatures, permissions or provenance, and it does not provide an encoder.

Frequently asked questions

Which binary formats are supported?

MessagePack, CBOR and BSON, all without a schema. Consecutive MessagePack objects, CBOR Sequence items and BSON documents are listed separately with item numbers and exact byte boundaries.

Is auto-detection reliable?

Auto mode tries all three formats and lists only error-free results that consume the entire input as complete candidates. Some bytes legitimately fit more than one format — 01 is both a MessagePack and a CBOR integer — so ambiguity and every candidate are shown instead of guessed away. Pin a format manually when you know it.

Are 64-bit integers, binary data and special types preserved?

Yes. The tree keeps the exact type and value. JSON export uses explicit wrappers for binary, extensions, CBOR tags and BSON ObjectId, Decimal128 and Timestamp values; integers outside JavaScript's safe range become decimal strings. NaN and Infinity are never silently turned into null.

Can the exported JSON be encoded back to binary?

No. Typed JSON is an inspection report, not a universal serializer. Maps use key/value arrays to retain duplicate and non-string keys, and BSON documents retain field order. Use an official library in your language when you need to encode the value again.

Is my data uploaded?

No. Parsing, diagnostics, copy and export all run in the current browser. Neither files nor inputs are sent to a server or added to the address bar automatically. Only “Share link” copies a link containing the original content (up to 6,000 bytes), so use it only for non-sensitive data.

See all questions

Go deeper

Related tools