Skip to content

Menu

MessagePack Decoder

MessagePack decoder and encoder. Paste hex or base64 to get JSON and an annotated byte breakdown, including ext types and timestamps. Runs in your browser.

Runs entirely in your browserEncodingFree, no sign-up
Loading tool

01What is MessagePack Decoder?

MessagePack Decoder turns MessagePack bytes into readable JSON and turns JSON back into MessagePack. Paste bytes as hex, with or without spaces, commas or 0x prefixes, or as standard or URL-safe base64. Auto-detect picks hex when the input is only hex digits in pairs, and you can force either format. Next to the JSON you get a byte breakdown table. Each row shows the offset, the bytes and what they mean, such as fixmap with 2 pairs, str 8 with 40 bytes, or uint 64. Rows are indented by nesting depth, so you can see which value belongs to which map or array. The decoder follows the official MessagePack spec and handles every format in it. That covers positive and negative fixint, the int and uint families up to 64 bits, float 32 and 64, nil and booleans. It also covers fixstr and str 8/16/32, bin 8/16/32, fixarray and array 16/32, fixmap and map 16/32, fixext 1 to 16 and ext 8/16/32. The byte 0xc1 is marked as never used and stops decoding with an error. Ext type -1 is decoded as the timestamp extension in all three layouts. Timestamp 32 holds unsigned seconds. Timestamp 64 packs 30 bits of nanoseconds above 34 bits of seconds. Timestamp 96 holds 32-bit nanoseconds, then a signed 64-bit seconds value. Nanoseconds above 999999999 are rejected. Other negative ext types are flagged, because the spec reserves them. When encoding, the tool picks the smallest format, as the spec recommends. So 127 becomes the single byte 7f, while 128 becomes cc 80. Floats are written as float 32 only when that keeps the exact value, otherwise float 64. That is why 1.5 costs five bytes and 0.1 costs nine. A worked example: {"id":7,"tags":["a","b"]} encodes to 82 a2 69 64 07 a4 74 61 67 73 92 a1 61 a1 62. That is 15 bytes against 25 for minified JSON. Going the other way, the base64 string k8u/+AAAAAAAAMCRoXg= decodes to [-1.5,null,["x"]], and the table shows a float 64 row, a nil row and a nested fixarray. To encode things JSON has no type for, write {"$bin": "hex"}, {"$ext": {"type": 5, "data": "hex"}} or {"$timestamp": "2024-01-01T00:00:00.5Z"}. Decoded output uses the same shapes, so you can round-trip. There are limits. JSON object keys must be strings, so a non-string map key is shown as its JSON text with a warning. Integers beyond the JavaScript safe range are shown as strings. When encoding, large integers typed into JSON may already have lost precision while the JSON was parsed. Only the first object is decoded, and any trailing bytes are reported. Everything runs in your browser, so your data is never uploaded.

Backend and game developers who send MessagePack over the wire or store it in caches and need to see what a payload really contains. The tool runs entirely in your browser, so your data never leaves your device.

02How to use MessagePack Decoder

  1. Choose MessagePack to JSON or JSON to MessagePack
  2. Paste hex or base64 bytes, or paste JSON when encoding
  3. Leave the input format on Auto-detect, or force hex or base64 if detection guesses wrong
  4. Read the JSON output and the byte breakdown table, and check any warnings above them
  5. Copy the JSON, hex or base64 output with the copy buttons

03Worked examples

Input: 82 a7 63 6f 6d 70 61 63 74 c3 a6 73 63 68 65 6d 61 00
Result: {"compact":true,"schema":0}
Breakdown rows: 82 fixmap, 2 pair(s); key 0: fixstr, 7 byte(s): "compact"; value 0: true; key 1: fixstr, 6 byte(s): "schema"; value 1: positive fixint 0.
Input: 81 a2 61 74 d7 ff 77 35 94 00 65 92 00 80
Result: {"at":{"$timestamp":"2024-01-01T00:00:00.500000000Z","seconds":1704067200,"nanoseconds":500000000}}
Row label: fixext 8, type -1 (timestamp 64): 2024-01-01T00:00:00.500000000Z.
Input: k8u/+AAAAAAAAMCRoXg= (base64)
Result: [-1.5,null,["x"]]
Rows: fixarray, 3 item(s); [0]: float 64 -1.5; [1]: nil; [2]: fixarray, 1 item(s); [0]: fixstr, 1 byte(s): "x".
Input: 92 01 c1
Result: Error: Byte 0xc1 at offset 2 is never used in MessagePack.
0xc1 is the one byte the spec leaves unused, so decoding stops there.
Input: {"id":7,"tags":["a","b"]} (JSON to MessagePack)
Result: 82 a2 69 64 07 a4 74 61 67 73 92 a1 61 a1 62
Input: [127, 128, -33, 1.5, 0.1] (JSON to MessagePack)
Result: 95 7f cc 80 d0 df ca 3f c0 00 00 cb 3f b9 99 99 99 99 99 9a
Smallest format each time: fixint, uint 8, int 8, float 32 for 1.5, and float 64 for 0.1.

04Common use cases

  • Reading a MessagePack payload captured from a Redis cache, a queue message or a WebSocket frame
  • Checking which format a library chose for a value, for example str 8 versus fixstr
  • Debugging a timestamp extension value that a client and server disagree about
  • Building a hex test fixture for a MessagePack parser from readable JSON
  • Comparing the size of a payload as MessagePack and as minified JSON
  • Finding where a corrupted or truncated payload stops making sense, byte by byte
  • Decoding a base64 MessagePack blob copied out of a log line or an HTTP body

05Tips

  • Switching direction carries the current result over, so you can decode, edit the JSON and encode it again
  • A short hex string like 'cafe' is also valid base64; if auto-detect picks the wrong one, set the input format by hand
  • If the table ends early with an end of data error, the payload was probably cut off, or the input holds a length prefix from a framing protocol
  • The spec says string bytes may be invalid UTF-8; the tool replaces bad bytes with U+FFFD and warns you
  • If an encoded float is longer than you expected, the value could not be stored exactly as float 32, so float 64 was used

06Related concepts

MessagePack, binary serialization, ext type, timestamp extension, fixmap, msgpack hex.

Frequently Asked Questions

What is MessagePack Decoder?

MessagePack Decoder is a free, browser-based developer tool on AIDToolStack. MessagePack decoder and encoder. Paste hex or base64 to get JSON and an annotated byte breakdown, including ext types and timestamps. Runs in your browser. It requires no installation or sign-up and works entirely in your browser.

Is MessagePack Decoder free to use?

Yes. No sign-up, no fees and no usage cap.

Does MessagePack Decoder store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe