1001Ferramentas
🔄Converters

CBOR to JSON (text) Converter

Explains CBOR (RFC 8949), its types and how to represent compact binary values in textual JSON.

Paste the CBOR bytes as hex. Byte strings come back as 0x…; tags return their contents. Indefinite-length items and bignums are not supported.

CBOR (Concise Binary Object Representation, RFC 8949) is a compact binary format whose data model mirrors JSON, with extra types on top: byte strings, timestamps and bignums.

To convert a whole CBOR file to JSON text, reach for a library such as cbor (Node) or cbor2 (Python). Types with no direct JSON equivalent — byte strings, for instance — are usually rendered as base64 or hex.

Reading CBOR bytes without installing anything

CBOR turns up in COSE, WebAuthn, digital certificates and device telemetry, always in the moments where you are handed a pile of bytes and need to understand the payload before writing a single line of code. Paste the hex sequence and the page hands back the equivalent JSON, indented. The sample a26161016162820203 becomes an object with a set to 1 and b set to the list 2, 3.

The reader follows the main path of RFC 8949: the top three bits of the head byte say whether you have an integer, a negative integer, a byte string, text, an array, a map, a tag or a simple value, and the low five bits carry the length. Half, single and double precision floats are all handled. Byte strings come out as text starting with 0x, and map keys always become strings in JSON, even when they were integers.

Two limits are worth knowing before you trust the output. Indefinite-length items, the 0x9f and 0xbf family, are not supported and the tool says so. Tags are unwrapped and then thrown away: a tag 1 timestamp gives you the bare integer 1363896240, and a tag 2 bignum gives you hex bytes instead of a number. When tags matter, use cbor on Node or cbor2 in Python. All decoding happens in your browser.

Frequently asked questions

Can I paste base64 instead of hex?
No, hex only. If your source hands you base64url, as WebAuthn responses do, convert it before pasting.
Why did my timestamp turn into a plain integer?
Because tags are unwrapped and discarded. Tag 1 marks a timestamp, but only the seconds integer inside it survives into the JSON.
Why does an indefinite-length array fail?
That encoding mode was not implemented. Re-encode with explicit lengths, or decode with the cbor library instead.

Related Tools