TXT · Text & Data tools

JSON to MessagePack

Output encoding
JSON
MessagePack bytes
MessagePackformat0 Bwritten0 Bas JSON0chars out
Open the full binary format decoder with every format and the encoder

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Encode a payload

Paste JSON and the MessagePack bytes appear as hex or Base64, with a download button for the raw file. Every value takes the shortest encoding that holds it, so 0 is one byte, 200 is two, and a 5-character key is six.

{"compact": true, "schema": 0} becomes 82a7636f6d70616374c3a6736368656d6100, 18 bytes against 30 for the JSON text.

Where the savings come from

MessagePack drops quotes, colons, commas, and braces, and stores lengths as counts instead of delimiters. Short strings cost one byte of overhead, small integers cost none at all beyond their own byte.

Payloads full of long unique strings save almost nothing, because a string is stored verbatim in both formats. Payloads full of small numbers, booleans, and repeated short keys save the most. The size comparison under the output makes that concrete for the payload in front of you rather than in general.

Types JSON cannot express

Timestamps, byte strings, and extension types exist in MessagePack but have no JSON spelling, so they cannot be produced from a JSON source here. A decoder reading them back will show them correctly; an encoder cannot invent them.

Integers larger than 2^53 are the other gap. JSON parsing rounds them before the encoder sees the value, so send those as strings if the exact digits matter.

Frequently Asked Questions

The smallest head byte that fits each value: fixint through int 64 for integers, fixstr through str 32 for text, fixmap and fixarray for small containers. Fractional numbers are written as float 64.

String values become str, which is what a JSON source means. The bin family carries raw bytes and has no JSON equivalent to come from.

Copy the hex and open the MessagePack decoder, or switch this page to the full tool and flip the mode to Decode.

Pages locked to one format

Full Binary Format Decoder tool

Explore Our Tools

Browse all tools