Get the latest tech news

From XML to JSON to CBOR


A Lingua Franca for Data? In modern computing, data exchange is foundational to everything from web browsing to microservices and IoT devices. The ability for different systems to represent, share, and interpret structured information drives our digital world.

This widespread adoption fostered a rich ecosystem of XML parsers, editors, validation tools, transformation engines (XSLT), data binding utilities, and dedicated conferences, building a strong technical community. The relentless push for greater efficiency, particularly driven by the rise of the Internet of Things (IoT), paved the way for a format that combined JSON's data model with the compactness and speed of binary encoding: CBOR. FeatureXMLJSONCBOR Originator/Body W3C (Jon Bosak et al.)Douglas Crockford; later ECMA, IETFIETF (Carsten Bormann, Paul Hoffman) Primary Goal Structured Docs, Web Data ExchangeSimple/Lightweight Web APIs, Data InterchangeBinary Efficiency, Compactness, Constrained Environments (IoT) Format Type Markup Language (Text)Data Format (Text)Data Format (Binary) Base Model SGML SubsetJavaScript Object Literal SubsetJSON Data Model Extension Structure Tag-based Tree (Elements, Attributes)Key-Value Pairs (Objects) & Ordered Values (Arrays)Key-Value Pairs (Maps) & Ordered Values (Arrays) Schema/Validation DTD, XSD (Built-in, Strong)JSON Schema (Separate Spec, Optional)CDDL (Separate Spec, Optional) Human Readability High (Verbose)High (Concise)Low (Binary) Size/Efficiency Verbose, Less Efficient ParsingLightweight, Efficient ParsingVery Compact, Highly Efficient Parsing Extensibility Namespaces, SchemaVia conventions (e.g., JSON-LD), JSON SchemaSemantic Tags (IANA Registry) Native Binary Support No (Requires Encoding, e.g., Base64)No (Requires Encoding, e.g., Base64)Yes (Byte String Type) Primary Use Cases Documents (HTML, DocBook), SOAP, Config FilesREST APIs, Config Files, NoSQL DataIoT Protocols (CoAP), Security (COSE), Constrained Devices

Get the Android app

Or read this on Hacker News

Read more on:

Photo of json

json

Photo of xml

xml

Related news:

News photo

3-JSON

News photo

Microsoft Office is using an artificially complex XML schema as a lock-in tool

News photo

Parsing JSON in Forty Lines of Awk