๐Ÿ”ท CBOR Encoder/Decoder

CBOR encoding/decoding, JSON conversion, diagnostic notation viewer
Zero DependenciesยทClient-SideยทNo Data Upload
Mode: -
Size: -
๐Ÿ“ Drag & drop a CBOR file here, or click to select
Results will appear here...

What Can the CBOR Encoder/Decoder Do?

The CBOR Encoder/Decoder is a free online tool for encoding and decoding CBOR (Concise Binary Object Representation) binary data. It supports JSON-to-CBOR conversion, diagnostic notation output, and Hex format viewing, helping developers debug and analyze CBOR data without installing any software.

Core Features

How to Use

1. Select the "Encode" tab and paste JSON data in the input box; or select the "Decode" tab and paste a CBOR Hex string

2. Choose the output format (Hex string / Diagnostic notation / Both) and Hex format

3. Click "Execute" to see the conversion result in the output area

4. Use "Copy Result" to copy to clipboard, or click "Download" to save as a file

5. Keyboard shortcut: Ctrl+Enter to execute quickly

Use Cases

Case 1: IoT Device Communication

CoAP protocol uses CBOR as its message format. IoT developers need to encode and decode CBOR data to debug device communication.

Case 2: WebAuthn Development

WebAuthn/FIDO2 protocol uses CBOR to encode authentication data. Developers need to decode CBOR to analyze authenticator responses.

Case 3: CWT Token Debugging

CWT (CBOR Web Token) uses CBOR encoding, similar to JWT but more compact. Developers need to decode CWT tokens to inspect their contents.

Case 4: Firmware Update Protocol

SUIT (Software Updates for Internet of Things) manifests use CBOR format. Firmware engineers need to inspect and verify manifest contents.

Technical Background

CBOR was designed by Carsten Bormann and Paul Hoffman, defined in RFC 8949 (originally RFC 7049). CBOR's design goal is to be the binary equivalent of JSON, but supporting more data types: integers (unbounded), byte strings, tags, simple values, etc. CBOR uses the top 3 bits of the first byte for the major type (0=unsigned int, 1=negative int, 2=byte string, 3=text string, 4=array, 5=map, 6=tag, 7=simple/float) and the low 5 bits for additional information. CBOR is widely used in IoT, WebAuthn, CWT, and other scenarios.

โ“ What is CBOR?

CBOR (Concise Binary Object Representation) is a binary data format defined in RFC 8949, designed as the binary equivalent of JSON. It is more compact and efficient, widely used in IoT and CoAP protocols.

โ“ What is the difference between CBOR and JSON?

CBOR is the binary version of JSON, supporting more data types (binary, tags, simple values), more compact encoding, and faster parsing. JSON is more human-readable, while CBOR is better suited for machine-to-machine communication.

โ“ Does this tool upload my data?

No. All encoding and decoding is done locally in your browser. No data is sent to any server. It works even offline.

โ“ What CBOR tag types are supported?

Standard tags are supported: Tag 0 (date string), Tag 1 (epoch time), Tag 2/3 (big integers), Tag 4/5 (decimals), Tag 21-23 (expected conversion), Tag 32 (URI), and more.

โ“ What is CBOR diagnostic notation?

Diagnostic notation is a human-readable text representation of CBOR, using h'...' for byte strings, 1(...) for tags, etc. It is useful for debugging and inspecting CBOR data structures.

โ“ Can I import CBOR data from a file?

Yes. You can drag and drop a CBOR binary file onto the input area, and the tool will automatically read and decode it.

CBOR Encoder/Decoder | No Signup, Client-Side ยท No Server Uploads

Feedback: dexshuang@google.com