CBOR Decode

This online CBOR decoding tool helps you decode CBOR bytes from file, Hex or Base64 to JSON or CBOR Diagnostic Notation. Read more

Decode CBOR to JSON or Diagnostic Notation

CBOR is the compact binary data format defined by RFC 8949. This tool reads CBOR bytes from Hex, Base64, a local file, or a URL and renders the data item as JSON or CBOR Diagnostic Notation.

How to use the decoder

For text input, specify whether the bytes are Hex or Base64. For file or URL input, the binary bytes are read directly. Choose JSON or Diagnostic output and press Decode. A decoded file produces downloadable cbor.json or cbor.txt output.

Understanding the output

JSON is convenient for values composed entirely of JSON-compatible objects, arrays, finite numbers, strings, booleans, and null. This page deliberately reports an error instead of silently converting unsupported values. Diagnostic Notation preserves visibility of byte strings, tags, simple values, non-string map keys, and other CBOR-specific details.

For example, Hex a16568656c6c6f65776f726c64 decodes to {"hello":"world"}. The byte string 43010203 displays as h'010203' in Diagnostic output but cannot be represented directly as JSON by this tool.

Important limitations

Untrusted CBOR may contain deeply nested or very large structures, so browser memory limits still apply. JSON output is intentionally limited, but JavaScript numbers also cannot exactly represent every integer available in the CBOR data model. Use Diagnostic output when inspecting protocol data or test vectors.

Frequently asked questions

Why does JSON output fail or change a value?

The CBOR item may use a type that JSON cannot represent exactly. Switch to Diagnostic Notation to inspect it.

Why does decoding fail?

Check that the source contains a complete CBOR data item and that Hex or Base64 was selected correctly. Truncated input, an unexpected break code, or unrelated trailing data can be invalid. Use CBOR Encode to generate a known-compatible test value.

Input
Output
Share Link
Settings