b2KIT

MessagePack Viewer & Converter

Decode MessagePack binary data to JSON and encode JSON to MessagePack with hex/base64 input.

Tested tool guide Tested browser tools Checked August 16, 2026

What MessagePack Viewer & Converter does, with a checked example

MessagePack Viewer & Converter translates between a MessagePack byte sequence and a JSON value. In decode mode, paste hexadecimal or Base64 bytes to inspect their JSON form. In encode mode, paste valid JSON and select hex or Base64 for the resulting MessagePack data. The common surprise is that MessagePack is not merely compressed JSON: it includes binary, extension, integer, and map-key types that JSON cannot always preserve. Some valid MessagePack values therefore have no lossless representation as ordinary JSON.

Worked example

A concrete input and expected output from the current implementation.

Input

81a16101

Expected output

{
  "a": 1
}

With hexadecimal input selected, 81 starts a one-entry map, a1 starts a one-byte string, 61 is the UTF-8 byte for "a", and 01 is the positive integer 1.

How the result is produced

1

Decoding bytes

Hex and Base64 are textual representations of the bytes being decoded. In hex mode, each pair of hexadecimal digits represents one byte. In Base64 mode, the encoded text first represents a byte sequence. MessagePack type markers within that sequence identify values such as maps, arrays, strings, integers, floating-point numbers, booleans, null, binary data, and extensions.

2

Encoding JSON

Encoding begins with a valid JSON value. JSON objects become MessagePack maps with string keys, arrays become arrays, and strings, booleans, and null retain their corresponding meanings. JSON's number syntax does not specify an integer width or floating-point width, so the resulting byte representation reflects a valid encoding choice. Equivalent decoded values do not necessarily imply identical MessagePack bytes.

Good uses

  • Decode a hexadecimal MessagePack payload copied from a protocol trace or application log.
  • Turn a small JSON fixture into Base64 MessagePack data for a test case or configuration field.
  • Compare the decoded structures of two binary payloads whose raw byte sequences differ.

Limits and checks

  • Select the correct input representation. Hexadecimal and Base64 encode MessagePack bytes; they are not MessagePack types or interchangeable spellings.
  • Binary values, extension values, and maps with non-string keys do not have direct, lossless equivalents in ordinary JSON.
  • For 64-bit integers, verify that the displayed result remains exact. Many browser number operations cannot exactly represent every integer whose magnitude exceeds 2^53 - 1.

Common questions

Why can valid MessagePack fail to become ordinary JSON?

MessagePack can carry raw binary values, extension values, map keys that are not strings, and integers that common JSON number handling may not preserve exactly. JSON has no direct form for several of these. Therefore, no, every valid MessagePack value is not guaranteed to have a lossless ordinary-JSON rendering. A conversion may require a wrapper convention, type substitution, or rejection.

Will encoding the decoded JSON recreate the original bytes?

Not necessarily. MessagePack permits multiple legal representations for some equivalent values, and conversion through JSON can discard MessagePack-specific type information. Map entry order can also change the bytes without changing the represented object. Compare decoded values when semantic equality matters. Compare the byte output only when exact wire identity is required.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools