Join our upcoming Webinar on Passkeys for B2C Enterprises

What is CBOR?

Vincent Delitz

Vincent

Created: May 3, 2024

Updated: March 27, 2025


What is CBOR (Concise Binary Object Representation)?#

Concise Binary Object Representation (CBOR)—sometimes referred to by its full form by those asking "what is CBOR?"—is a data format that aims to provide the benefits of JSON but in a more compact and efficient binary form. Defined in RFC 8949, CBOR's design supports extremely small code sizes, small message sizes, and easy extensibility without version negotiation. This efficient encoding is a clear example of how the cbor format and cbor encoding improve data interchange compared to traditional textual formats.

Slack Icon

Become part of our Passkeys Community for updates & support.

Join

CBOR Object Signing and Encryption (COSE) algorithms are used to generate passkeys. The type of algorithm is stored within the attestation-object of a passkey operation:

Passkeys are generated with COSE Algorithms, indicating the used algorithm in the algorithm-attribute of the parsedCredentialPublicKey

  • CBOR: A binary data format that enhances JSON's model with compact, efficient data encoding, demonstrating the true cbor meaning as a concise binary object representation.
  • Designed for fast processing and small message sizes, ideal for the Internet of Things (IoT).
  • Supports extensibility with tags for evolving data needs without strict schema requirements.

CBOR Concise Binary Object Representation (CBOR) is a data format based on JSON, providing a more compact and efficient form.

Understanding CBOR and Its Design#

CBOR builds on the JSON data model, encompassing types such as numbers, strings, arrays, and maps, adding more like bytes for binary data not efficiently handled by JSON. For developers looking to cbor decode or convert cbor to json, here’s how CBOR refines data interchange:

Schema-Free Interchange#

Like JSON, CBOR allows for effective data interchange without rigid schema enforcement, facilitating flexible development and rapid evolution at both ends of a communication channel. This advantage is central when comparing cbor vs json, where the binary nature of CBOR leads to smaller payloads.

Binary Data Handling#

Unlike JSON, which requires encoding for binary data (typically in base64), CBOR embraces binary natively. This means that application/cbor can readily represent binary data like encryption keys or sensor readings without extra overhead, making it a solid choice when evaluating cbor format and encoding efficiencies.

Substack Icon

Subscribe to our Passkeys Substack for the latest news.

Subscribe

Efficient and Compact#

CBOR's binary nature ensures data is not only more concise but also processed faster than textual formats, crucial for performance-critical applications like those in IoT.

Stability and Extensibility#

As a stable Internet Standard, CBOR is designed to remain relevant and supportive of new technologies for decades. It supports extensibility through tags that allow for additional data types without altering the core specifications. Developers exploring cbor json and cbor vs json techniques will find that CBOR’s robust structure helps streamline integration in modern applications.

Practical Applications of CBOR#

  • Internet of Things (IoT): CBOR is particularly advantageous for IoT devices, which benefit from its low overhead and efficient data encoding.
  • Inter-device Communication: CBOR facilitates compact and quick data exchange between devices in constrained environments.
  • Data Security: CBOR Object Signing and Encryption (COSE) provides robust security mechanisms, crucial for secure, authenticated, and private data exchange.
Debugger Icon

Want to experiment with passkey flows? Try our Passkeys Debugger.

Try for Free

CBOR FAQs#

How does CBOR differ from JSON?#

CBOR is a binary format that reduces the size and increases the speed of data interchange. When comparing cbor vs json, CBOR offers a more efficient mechanism for data exchange because it does not include the overhead of text-based formatting, making cbor encoding a preferred choice for performance-critical applications.

Is CBOR compatible with JSON?#

Yes, CBOR is based on the JSON data model and can represent all JSON data types, plus additional binary types. This compatibility facilitates cbor decode processes and even allows for easy cbor to json conversions when necessary.

Ben Gould Testimonial

Ben Gould

Head of Engineering

I’ve built hundreds of integrations in my time, including quite a few with identity providers and I’ve never been so impressed with a developer experience as I have been with Corbado.

3,000+ devs trust Corbado & make the Internet safer with passkeys. Got questions? We’ve written 150+ blog posts on passkeys.

Join Passkeys Community

How secure is CBOR?#

CBOR itself focuses on data representation. Security can be implemented on top of CBOR using COSE, which adds signing, encryption, and message authentication. This layered security model ensures that even as you benefit from the efficiency of the cbor encoding, robust security measures are in place.

Can CBOR be extended for specific needs?#

Absolutely. CBOR's tagging system allows it to adapt to future requirements and incorporate new data types without disrupting existing implementations, making it a truly flexible cbor format for modern applications.

What is needed to implement CBOR in an application?#

Implementing CBOR requires a CBOR parser and generator. Many programming languages have libraries available that support CBOR. Understanding the interplay between what is cbor and how it serves as a concise binary object representation can help in selecting the right tools for cbor encoding and integration into existing systems.

Add passkeys to your app in <1 hour with our UI components, SDKs & guides.

Start for free

Share this article


LinkedInTwitterFacebook

Enjoyed this read?

🤝 Join our Passkeys Community

Share passkeys implementation tips and get support to free the world from passwords.

🚀 Subscribe to Substack

Get the latest news, strategies, and insights about passkeys sent straight to your inbox.