Skip to content
UniKit

MessagePack viewer

Decode MessagePack binary data in your browser: nil, bool, int, float, str, bin, array, map and ext are all supported, shown as a collapsible tree with the type, byte length and offset of every value, plus a JSON view.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Decoded value

Paste hex bytes to decode them

Selected node

Paste hex bytes to decode them

JSON view

Binary and ext values are rendered as hex strings; 64-bit integers outside the safe range are strings.

What this tool does

  • Debug a service that speaks MessagePack: paste the captured payload as hex and see the type, byte length and offset of every value instead of counting bytes against the spec by hand.
  • Verify your own serializer: pack the same data in code and compare the tree node by node to spot an integer written as a float or a wrong length prefix.
  • Read binary payloads as JSON: the JSON view turns maps into objects and arrays into arrays, with binary and ext values rendered as hex strings you can copy.
  • Track down stray bytes: the result reports how many bytes the top-level value consumed and how many are left over, which immediately shows whether a second message is glued on.

Example

Input

82 a1 61 01 a1 62 92 c3 cb 3f f0 00 00 00 00 00 00

Output

{
  "a": 1,
  "b": [
    true,
    1
  ]
}

This is the JSON view: the sample is a fixmap holding a → 1 and b → [true, 1.0] (the 1.0 comes from a float64). The tree view additionally shows each node's wire type (fixmap, str, float64 …) and offset.

Frequently asked questions

How should I format the hex input?

Whitespace, commas, semicolons, colons and hyphens all work as separators, and a 0x prefix is accepted — "82 a1 61 01", "82,a1,61,01" and "0x82 0xa1" are all valid. The digit count must be even; other characters raise a malformed-hex error.

Why do I get "not valid MessagePack data"?

Two typical causes: an illegal prefix byte (0xc1 is reserved by the spec) or truncated input, such as a declared 4-byte length followed by only 2 bytes. Nesting deeper than 64 levels is also rejected as a guard against blowing the call stack.

Why is a big integer rendered as a string?

MessagePack int64/uint64 can exceed the JavaScript safe integer range, and converting to Number would silently lose precision. Values outside ±2^53-1 are therefore emitted as strings in the JSON view, while the tree always shows the exact decimal string.

What are ext types, and is timestamp handled?

An ext value is "1 type byte + payload", and its meaning is defined by the application, so the tool shows the type number and the payload hex. The one special case is type -1, the MessagePack timestamp extension, which is rendered as a readable time.

Is a real payload uploaded anywhere?

No. The decoder is a self-contained TypeScript module running locally, the page makes no network requests, and payload contents are never logged.

Keywords:msgpackmessagepackbinarydecodehexserializationextMessagePack 解析二进制查看序列化十六进制树形视图

Related tools