Skip to content
uencoder

UBJSON Format

UBJSON (Universal Binary JSON) is an alternative specification to BSON, encoding JSON-compatible structures with type markers plus compact values, and supports optimized container lengths.

Purpose

It provides a cross-language, stream-friendly binary JSON format, emphasizing parsing simplicity and compactness.

Mechanism

Every value starts with a 1-byte type marker (M = map, A = array, i = int8, I = int16, l = int32, L = int64, d = float, D = float64, s = string, Z = null, etc.) followed by the compactly encoded value. Containers may carry a length prefix to speed up skipping.

Use cases

  • Streaming binary JSON
  • Embedded data exchange
  • Cross-language serialization

Related tools

References