---
url: 'https://www.corbado.com/glossary/cbor'
title: 'CBOR'
description: 'Explore what Concise Binary Object Representation (CBOR) is, its advantages over JSON, and its role in secure data interchange.'
lang: 'en'
keywords: 'cbor'
---

# CBOR

## 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.

**CBOR Object Signing and Encryption (COSE) algorithms** are used to generate passkeys.
The type of algorithm is stored within the [attestation](https://www.corbado.com/glossary/attestation)-object of
a passkey operation:

![Passkeys are generated with COSE Algorithms, indicating the used algorithm in the algorithm-attribute of the parsedCredentialPublicKey](https://www.corbado.com/website-assets/cs_2_3_COSE_algorithms_058abc0757.png)

> - **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.

---

### 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.

#### 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](https://www.corbado.com/blog/how-to-use-passkeys-apple-watch).

#### 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](https://www.corbado.com/blog/how-to-use-passkeys-apple-watch) 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.

---

## 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.

### How secure is CBOR?

CBOR itself focuses on data representation. Security can be implemented on top of CBOR
using [COSE](https://www.corbado.com/blog/webauthn-pubkeycredparams-credentialpublickey), 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.
