Implementations

CBOR is simple enough to implement from scratch for a specific application.
For applications where that is not desirable, generic implementations are available for a variety of platforms. Many of these implementations stay private, but some are published with liberal open-source licenses such as the Apache 2.0 or the MIT license.
Many implementations use a simple API of the form:
encoded = CBOR.encode(data)data = CBOR.decode(encoded)


JavaScript

JavaScript implementations are available both for in-browser use and for node.js:

Browser

A CBOR object can be installed via bower install cbor and used as an AMD module or global object in the browser e.g. in combination with Websockets…

View details »

node.js

… and the server side for that might be written using node.js; install via: npm install cbor

View details »

Also, an implementation based on the higher speed C library tinyCBOR is now available:

View details »

cbor-sync provides an extensible CBOR encoder/decoder:

View details »

Duktape

A CBOR binding for both C and JavaScript:

View details »

Dart

A CBOR encoder/decoder suite with a test suite that incorporates the encode/decode tests from RFC7049 and more is now available in the Darts package ecosystem:

View details »

PHP

API: \CBOR\CBOREncoder::encode($target) and \CBOR\CBOREncoder::decode($encoded_data)

View details »

Spomky-Labs/cbor-php is a simple, fast and complete implementation of the specification: it supports all major types and provides abstract classes to extend the library with, e.g., custom tags
The library is well tested and works from PHP7.3 and up, including PHP8

View details »

Perl

Install a comprehensive implementation tailored to Perl's many features via: cpan CBOR::XS

You'll like the performance data…

View details »

Install a fast, simple implementation that supports current Perl versions and whose license works well with both open- and closed-source projects: cpan CBOR::Free

View details »

Or, if you need pure Perl, try: cpan CBOR::PP

View details »

Go

The newest Go implementation is fast, safe, and full-featured with API like JSON + toarray/keyasint struct tags:

View details »

Another full-grown Go implementation:

View details »

A comprehensive, high-performance implementation as part of a larger set of data representation format en- and decoders:

View details »

Rust

An implementation using Serde, a framework for serializing and deserializing Rust data structures efficiently and generically, is available on crates.io. It is maintained, but it does not support CBOR Tags, and the upstream serde module has declined to add support:

View details »

The CBOR-CODEC implementation, available on crates.io, supports Tags and can deal with objects without size limits:

View details »

The CBOR-RUST implementation has very little documentation, and claims to be not ready for production:

View details »

The rust-cbor implementation works with Cargo and is on crates.io, but is considered unmaintained. It does support CBOR Tags:

View details »

cbor-diag is another parser targeted specifically at generating diagnostic notation and annotated hex for debugging:

View details »

Swift

A Swift implementation without a Foundation dependency (cross-platform ready):

View details »

Another, work-in-progress Swift implementation that is geared towards integration in iOS and macOS via Cocoapods:

View details »

A Swift implementation fully setup for Swift's Codable Protocols for iOS, macOS, tvOS, and watchOS via Cocoapods, Carthage, or Swift Package Manager:

View details »

PotentCodables bolsters the Swift Codable system with support for JSON, CBOR, and even ASN.1:

View details »

Lua

Lua-cbor is a pure Lua implementation of CBOR for Lua 5.1—5.3, which utilizes struct packing and bitwise operations if available:

View details »

“The most comprehensive CBOR module in the Lua universe” supports everything mentioned in RFC 7049 and the extensions registered with the IANA so far. It comes with parts implemented in C.

View details »

lua-ConciseSerialization is a pure Lua implementation of CBOR with variants for both 5.1 and 5.3; install via luarocks install lua-conciseserialization.

View details »

Python

Install an actively maintained, high quality implementation that supports most CBOR tags, including those for representing cyclic (recursive) references, via pip install cbor2

View details »

Flynn's' simple API is inspired by existing Python serialisation modules like json and pickle:

View details »

Flunn is a fork of flynn, fixing some compatibility issues and with some refactoring:

View details »

Ruby

A high-speed implementation has been derived from the MessagePack implementation for Ruby. Installation: gem install cbor

View details »

Ruby bindings for libcbor are now available. Installation: gem install libcbor

View details »

Erlang, Elixir

cbor-erlang is an early implementation in Erlang:

View details »

Based on an older Elixir implementation, an implementation with a modernized code base is now available:

View details »

A recent Erlang implementation emphasizes features such as extensible tag support, documentation, a larger test suite, a configurable depth limit, etc.:

View details »

Haskell

An early implementation has been on hackage for a while:

View details »

cborg, a more recent implementation, aims for higher speed and more features, and comes with tools and a JSON converter. It is also the basis for the Haskell serialise package:

View details »

OCaml

The cbor package is a minimal and lightweight implementation of just the core CBOR data structures. It encodes and decodes to and from OCaml strings:

View details »

The orsetto package is a serialization framework that includes streaming encoders and decoders for both JSON and CBOR:

View details »

Scala

Idiomatic, lightweight and fast CBOR (de)serialization in Scala. Zero dependencies, type-class based, easy to integrate.

View details »

Clojure

clj-cbor is an extensible, native Clojure implementation of the CBOR format:

View Details »

D

A compact D implementation with a Dub package:

View Details »

Crystal

Encoding and decoding library with a simple API inspired by the Crystal stdlib JSON package:

View Details »

Julia

CBOR.jl is a Julia package for working with the CBOR data format, providing straightforward encoding and decoding for Julia types. Install via: Pkg.add("CBOR")

View details »

Java

A Java implementation as part of the popular Jackson JSON library is at:

View Details »

A Java 7 implementation focusing on test coverage and a clean separation of model, encoder and decoder is at:

View Details »

JACOB, a small CBOR encoder and decoder implemented in plain Java is at:

View Details »

borabora supports graph queries and lazy decoding of stream elements:

View Details »

Cyborg supports a stream parsing/generation API without the need to adapt your data to a specific model:

View Details »

C#, Java

A rather comprehensive implementation that addresses arbitrary precision arithmetic is available in both a C# and a Java version.

View details »

C#, F#, VB.net

Dahomey.Cbor is a high-performance CBOR serialization framework for .Net (C#, F#, VB.net):

View Details »

System.Formats.Cbor is the built-in solution for .Net (C#, F#, VB.net):

View Details »

C, C++

A C implementation for highly constrained nodes, which achieves a full CBOR decoder in 880 bytes of ARM code (and now also includes an encoder), has been around for a while:

View Details »

A basic C++ implementation is also available:

View Details »

libcbor provides a fully-fledged C99 implementation, including streaming and incremental processing functionality:

View details »

TinyCBOR is Intel's industrial strength C/C++ implementation of CBOR, as used in the IoTivity framework:

View details »

JSON for Modern C++ — a header-only C++ library that aims to promote JSON to a first-class data type in C++11 — now supports CBOR as (de)serialization format.

View details »

The old Qt implementation is now deprecated, as Qt from version 5.12 now has built-in support:

View details »

GoldFish is a fast, header-only C++11 library for CBOR and JSON that minimizes memory allocation by providing a SAX-like, but pull-oriented interface. Currently only ported to Visual C++.

View details »

jsoncons is a C++11, header-only library for JSON construction that supports encode to/decode from CBOR.

View details »

CBOR-lite is a simple Modern C++ header-only implementation designed for encoding and decoding of CBOR-based application level-protocols.

View details »

cborg seems to be a popular name for a CBOR implementation, here for C++ with a fluent interface:

View details »

A simple low-level streamed callback-based CBOR push parser in C and C++:

View details »

A basic C++ implementation heavily based on C++17 variants:

View details »

Not exactly a coder/decoder per se, but more type based compile time encoder/decoder generator that uses CBOR as one of underlying protocols:

View details »

A "zero-memory-footprint" C decoder in use on some microcontroller/IoT deployments with no memory allocation:

View details »

Qcbor is a full implementation of CBOR in highly portable C. Commercial quality with measures for software security, small code size, a test suite and documentation.

View details »