Home

CBOR

Introduction

The CBOR (Concise Binary Object Representation) format is a binary serialization format defined in RFC 8949. It follows the data model of JSON closely but uses a compact binary encoding, making it faster to parse and smaller to store than text-based formats. For further details, see the CBOR specification.

Stencila supports CBOR as a faster, more compact alternative to JSON for storing and transferring documents. Like JSON, conversion is lossless — all Stencila Schema node types and properties are preserved through round-trips.

Usage

Use the .cbor file extension, or the --to cbor or --from cbor options, when converting to/from CBOR e.g.

stencila convert doc.smd doc.cbor

Implementation

Stencila supports lossless, bi-directional conversion between Stencila documents and CBOR powered by the Rust crate ciborium.

Limitations

  • CBOR files are not human-readable. For a human-readable lossless format, use JSON, JSON5, or YAML.

  • No built-in compression. For smaller files, use CBOR+Zstd which adds Zstandard compression.

© 2026 Stencila