JSON ↔ MessagePack / CBOR

Client

Encode JSON into compact binary (MessagePack or RFC 8949 CBOR), or decode a Base64 payload back to pretty JSON. Sample JSON is pre-filled so you can try encoding immediately—everything runs locally in your tab.

Learn more: MessagePack and CBOR

Serialize JSON-compatible values into binary MessagePack or CBOR, and decode Base64-encoded bytes back to pretty JSON—useful for smaller wire payloads and interoperability checks.

Binary vs JSON text

MessagePack and CBOR are compact binary formats; size is often smaller than minified JSON, especially with many short keys or numeric arrays. They can also represent types JSON does not (for example certain byte strings or extension types), so round-tripping through JSON may drop information.

Base64 panel

The tool shows the encoded bytes as standard Base64 text so you can copy into logs, HAR exports, or tickets. Whitespace in the Base64 field is ignored when decoding.

JSON & binary

?

JSON → binary uses JSON.parse then @msgpack/msgpack encode. Binary → JSON decodes bytes then pretty-prints with JSON.stringify (BigInt and simple Map/Set values are coerced for display).

MessagePack and CBOR can represent types JSON does not (e.g. byte buffers, certain number precisions). Round-trip through JSON may lose information—validate in the system that consumes the binary format.

Format

Choose MessagePack or CBOR, then JSON → binary or binary → JSON. The right panel is standard Base64 of the raw bytes (whitespace ignored).

Common use cases

  • Inspect API payloads that use MessagePack or CBOR instead of raw JSON.
  • Compare size between JSON text and a binary encoding before wiring a client or device.
  • Decode a captured Base64 blob when logs or traces only show the compact form.

Common mistakes to avoid

  • Expecting identical bytes across libraries

    Key order and optional CBOR tags can differ. For checksums, normalize or compare decoded values, not raw bytes.

FAQ

Are documents uploaded?

No. Encoding and decoding run in your browser from what you paste.

Related utilities you can open in another tab—mostly client-side.