Skip to content
AZ Tools

MessagePack Decoder

MessagePack is what a service reaches for when JSON is too big and protobuf is too much ceremony: the same values, packed into bytes. That compactness is the problem when something goes wrong, because a payload out of a cache, a queue or a log is unreadable without decoding it. This reads the whole format and keeps the distinctions JSON would lose. Integers come back with the width they were written at, and a 64-bit value that will not fit in a JavaScript number is kept as a string rather than quietly rounded. Binary blobs stay binary instead of being mangled into text — the split between str and bin arrived after the format shipped, and conflating them is exactly how a decoder corrupts data. Extension types are reported with their number, and the timestamp extension is decoded properly in all three of its encodings. The result is shown as a tree with the type of every value, and as JSON with the things JSON cannot express written out rather than flattened. If the input holds more bytes than one value needs — which is what a stream of concatenated messages looks like — it says how many are left over instead of pretending the rest is not there. Nothing is uploaded.

Paste a base64 or hex MessagePack payload to decode it.

How to use

  1. Paste the payload as base64 or hex — the format is detected, and you can force it.
  2. Read the tree: each row shows the key, the MessagePack type and the value.
  3. Copy the JSON when you want to process the values elsewhere.
  4. Drop a binary file to decode a captured payload straight from disk.
  5. Check the trailing-bytes note if the payload is a stream of several messages.

Frequently asked questions

What is the difference between str and bin?
MessagePack originally had one raw type used for both text and bytes. The 2013 revision split it into str for UTF-8 text and bin for arbitrary bytes, because a decoder cannot otherwise tell whether to decode the bytes as text. Treating a bin as a string is how binary data gets corrupted, so the two are kept apart here.
Why is a large integer shown as a string in the JSON?
A JavaScript number holds integers exactly only up to 2^53. MessagePack has full 64-bit integers, so anything past that limit is written as a string in the JSON output — losing the digits silently would be worse than the inconvenience.
How are timestamps decoded?
The timestamp extension, type -1, has three encodings: four bytes of seconds, twelve bytes of nanoseconds and seconds, and an eight-byte form that packs thirty bits of nanoseconds above thirty-four bits of seconds in one word. That last one is the trap — read as a plain integer it gives a date tens of thousands of years out.
What does the trailing bytes warning mean?
MessagePack values are self-delimiting, so several can sit back to back in one buffer. When the first value ends before the input does, the rest is usually another message. The count tells you how much is left rather than silently ignoring it.
What about extension types other than timestamps?
They are shown with their type number and their payload in base64. An extension's meaning is defined by the application that wrote it, so there is nothing generic to decode it into.
Is my payload uploaded?
No. The bytes are decoded in your browser and nothing is sent to a server.

Related tools