MessagePack to JSON Converter

Decodes hex-encoded MessagePack, nil, bool, every integer width, float32 and float64, str, array, and map, back into readable JSON. Doesn't decode the bin or extension type families, which have no JSON equivalent. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-24

Overview

Introduction

MessagePack payloads show up in Redis captures, msgpack-rpc traces, and cache dumps as a wall of hex bytes with no obvious structure. This tool decodes that hex dump straight back into readable JSON.

It reads the same type-tagged byte format the companion JSON to MessagePack Converter writes, so the two tools round-trip cleanly for testing.

What Is MessagePack to JSON Converter?

A MessagePack decoder that reads a hex-encoded byte sequence one type-tagged value at a time and reconstructs the equivalent JSON value, recursing into nested arrays and maps.

It covers nil, bool, all integer widths, both float formats, str, array, and map, the full set of types that map cleanly onto JSON's data model.

How MessagePack to JSON Converter Works

The decoder reads one leading byte at a time: values in the fixint, fixmap, fixarray, and fixstr ranges are recognized directly from the byte's value, while explicit type bytes (like 0xcd for uint16 or 0xdb for str32) trigger reading the appropriate number of following bytes.

Arrays and maps recurse by calling the same value-reading routine for each element or key/value pair, so nesting of any depth is handled without special-casing.

When To Use MessagePack to JSON Converter

Use it when you have a MessagePack hex dump from a Redis capture, an RPC trace, or the JSON to MessagePack Converter and need to see the actual data it encodes.

It's also useful for verifying a custom MessagePack encoder in another language produced spec-correct bytes by comparing its decoded output against the source JSON.

Features

Advantages

  • Decodes every fixed and variable-width integer, float, string, array, and map format in the spec.
  • Runs entirely client-side with no server round-trip for potentially sensitive payload data.
  • Reports a specific error naming the unsupported byte rather than failing silently on bin or ext types.

Limitations

  • Doesn't decode the bin or extension type families, since neither has a direct JSON equivalent to decode into.
  • Expects a hex-encoded string, not a raw uploaded .msgpack binary file.
  • Integers larger than Number.MAX_SAFE_INTEGER lose precision when converted to a JavaScript number, the same limit JSON itself has.

Examples

Decoding a small object

Input

83 a4 6e 61 6d 65 a3 41 64 61 a3 61 67 65 1e a6 61 63 74 69 76 65 c3

Output

{
  "name": "Ada",
  "age": 30,
  "active": true
}

The fixmap byte 0x83 signals 3 key/value pairs, decoded in order into a JSON object.

Truncated input

Input

83 a4 6e 61

Output

Unexpected end of input.

The map header promises 3 entries but the bytes end mid-string, so decoding stops with a clear error.

Best Practices & Notes

Best Practices

  • Use the exact hex output from JSON to MessagePack Converter when testing the pair, to avoid introducing a malformed length byte by hand.
  • Strip any non-hex formatting, like 0x prefixes or commas, before pasting; the decoder expects plain space-separated hex pairs.
  • If decoding fails partway through, check the most recently read length-prefixed value first, that's the most common place a hand-edited hex dump goes wrong.

Developer Notes

The decoder shares its ByteReader and readValue dispatch table with the encoder in msgpack-core.ts, reading the leading byte's numeric range first (fixint/fixmap/fixarray/fixstr) before falling through to a switch statement over the explicit type-tag bytes, which mirrors how the MessagePack spec itself lays out the format's byte ranges.

MessagePack to JSON Converter Use Cases

  • Inspecting a MessagePack payload captured from Redis or an msgpack-rpc call
  • Verifying a custom MessagePack encoder in another language produced spec-correct bytes
  • Round-tripping data through JSON to MessagePack Converter and back to confirm nothing was lost

Common Mistakes

  • Pasting a raw binary .msgpack file's contents instead of its hex representation.
  • Expecting bin or ext type bytes to decode; they're explicitly rejected since JSON has no representation for them.
  • Leaving formatting like commas or 0x prefixes between hex bytes, which breaks the hex validation step.

Tips

  • Pair with JSON to MessagePack Converter to round-trip a payload and confirm both directions agree.
  • If decoding fails, check whether the source system emitted a bin or ext type, both are outside what this decoder supports.

References

Frequently Asked Questions