JSON ↔ MessagePack / CBOR
ClientEncode 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.
79 characters total · max ~ 2.0M bytes encoded
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.
More tools
Related utilities you can open in another tab—mostly client-side.
YAML ↔ JSON
ClientYAML to JSON and JSON to YAML online—format, validate, convert locally.
TOML ↔ JSON
ClientTOML to JSON and JSON to TOML online—format, validate, convert locally.
CSV ↔ JSON
ClientPaste a table or JSON array of objects—convert both ways, choose delimiter, client-side.
Encoding tools
ClientBase64 and URL on this page; hub lists hex, HTML entities, JWT, JSON helpers, crypto, and tokens.