MessagePack Converter

Convert between JSON and MessagePack (hex / base64).

Open tool

Overview

The MessagePack converter round-trips between JSON and MessagePack (msgpack) binary encoding. Paste JSON to get hex or base64-encoded MessagePack bytes, or paste MessagePack to recover the document as readable JSON.

MessagePack is the compact binary serialisation used by Redis, fluentd, and many embedded protocols. Developers writing client libraries, debugging a binary payload, or generating test vectors for an msgpack-aware service reach for a msgpack decoder to peek at bytes without spinning up a script.

How it works

MessagePack defines a compact binary representation of the JSON data model plus a few extensions: raw binary, extension types, and a timestamp extension. Each item starts with a single byte that often encodes both type and a small value or length; larger items extend with 1, 2, 4, or 8 byte length fields.

The converter handles every standard type — positive and negative fixints, fixed and variable-length strings, arrays, maps, binary blobs, floats, booleans, and nil — plus the timestamp extension (type -1) which decodes to ISO 8601 strings. Map keys can be any MessagePack value; non-string keys are represented in JSON using a special marker so the round trip stays lossless.

Examples

JSON in:  {"a":1,"b":"hi"}
msgpack:  82 a1 61 01 a1 62 a2 68 69
JSON in:  [1, 2.5, "hi"]
msgpack:  93 01 cb 4004 0000 0000 0000 a2 68 69
msgpack in (hex): 81 a3 6b 65 79 a5 76 61 6c 75 65
JSON out:         {"key":"value"}

FAQ

Why use MessagePack instead of JSON?

MessagePack is typically 30–50% smaller than equivalent JSON and parses faster, especially for documents with many numeric values or repeated short strings. It's used by Redis (RESP3 alternative), fluentd, and several IoT frameworks.

How does it compare to CBOR?

Both are compact binary JSON-shaped formats. CBOR (RFC 8949) is an IETF standard with a richer tag system; MessagePack is older, simpler, and slightly more compact for typical workloads. Pick based on what your peer system speaks.

Does the converter handle the timestamp extension?

Yes — extension type -1 with the standard length encoding decodes to ISO 8601 strings. Round-tripping preserves the value back to the extension type on the way out.

Try MessagePack Converter

An unhandled error has occurred. Reload ×