CBOR Decode
Convert a CBOR byte sequence back to JSON.
Decode CBOR (RFC 8949) hex or Base64 to JSON. Free, offline, runs in your browser. Read more Show less
What is CBOR Decode?
This tool converts a CBOR byte sequence back into its JSON representation. CBOR is defined in RFC 8949 and is used by COSE (WebAuthn, FIDO2), CoAP (IoT), and many blockchain and DID systems.
Paste the CBOR as hex or Base64. The tool parses the bytes and prints the equivalent JSON.
How to decode
Choose the input encoding matching your CBOR source, paste the value, and read the JSON.
For example, the hex a1616101 decodes to:
{"a":1}
What this tool cannot decode
This tool decodes the JSON-compatible subset of CBOR: integers, floats, strings, arrays, maps, booleans, and null. It does not display:
Byte strings - CBOR byte strings become placeholder objects showing the byte count. To work with them, use a library directly.
Tags - CBOR tags (dates, bignums, URIs) are decoded to their numeric tag wrapper.
Indefinite-length items - supported by the parser but normalized into the equivalent definite form.
FAQ
Why do I get "not valid CBOR"?
Either the bytes are truncated, the input encoding is wrong (hex vs Base64), or the value contains a tag or feature not supported by this tool.
What does "diagnostic notation" mean?
RFC 8949 defines a human-readable diagnostic notation for CBOR, similar to what you would expect from JSON but with CBOR's extra types shown as tags and byte strings. Some CBOR tools display that; this tool shows JSON.
Can I round-trip through this tool?
Yes, for JSON-compatible values. Encode JSON with CBOR Encode, then paste the output here - you will get the same JSON back.
Is CBOR smaller than JSON?
Usually. Integers take 1 byte, short strings take 1+n bytes, and there are no quotes or commas. For very small payloads the difference is small; for structured data with many integers and short keys, CBOR can be 30-50% smaller.
Command line equivalent
# Node with cborg
node --input-type=module -e '
import { decode } from "cborg";
const bytes = Buffer.from("a1616101", "hex");
console.log(JSON.stringify(decode(bytes)));
'
# Python with cbor2
python3 -c "import cbor2; print(cbor2.loads(bytes.fromhex('a1616101')))"