UtilDojo

Popular

Menu

MessagePack Decoder — Decode MsgPack Hex or Base64

  • This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.

Bytes (hex or Base64)

Paste, type or drop a file

Decoded

Paste bytes to decode them

Paste or type on the left, upload a file, or drop one onto the input.

Waiting for input

See also

About this tool

MessagePack is often described as “JSON, but binary”: the same maps, arrays, strings, numbers and booleans, written in fewer bytes. Redis clients, RPC systems and game servers use it, and what comes out of a debugger or a packet capture is a run of bytes. Paste them here as hex or Base64 and they are decoded into readable text.

Take the official example, 82 a7 63 6f 6d 70 61 63 74 c3 a6 73 63 68 65 6d 61 00. Its first byte 82 means a map of two entries, a7 starts a 7-character string, c3 is true and 00 is the number zero, so it decodes to {"compact": true, "schema": 0} in 18 bytes. The Sample button loads a larger record you can step through.

Integers up to 64 bits are shown exactly, which JavaScript’s own numbers cannot do, binary data appears as h'cafe' and map keys do not have to be strings. Extension types are shown with their type number, and the built-in timestamp (type -1) is converted to a date. A timestamp such as d6 ff 00 00 00 00 reads 1970-01-01T00:00:00.000Z.

Only the first value is decoded, with a warning for leftover bytes, and an error gives the byte offset. The byte 0xc1 is never valid in MessagePack, so seeing it means the data is something else. The tool also reads CBOR and Protocol Buffers on its other tabs. Nothing is uploaded.

Frequently asked questions

Is the output valid JSON?

It is JSON-like. Strings, numbers, arrays and maps look the same, but binary data, extension types and non-string keys have no JSON form, so they are written as `h'…'`, `ext(…)` and plain keys.

What does the first byte tell me?

It says what the value is: 0x00 to 0x7f is a small positive number, 0x80 to 0x8f a small map, 0x90 to 0x9f a small array, 0xa0 to 0xbf a short string, and 0xc0 to 0xdf the larger or rarer types.

Why are there bytes left after decoding?

Either two values were joined together, or the data is not MessagePack. Try the CBOR and Protobuf tabs.

Can it decode a file?

Yes. Use Open binary file for anything up to 256 KB, and it is converted to hex in the input box.

Related tools