Content deleted Content added
Cybercobra (talk | contribs) →Comparison table: OGDL creator |
m resize table font |
||
(692 intermediate revisions by more than 100 users not shown) | |||
Line 1:
{{Short description|None}}
This is a '''comparison of [[data serialization]] formats''', various ways to convert complex [[object (computer science)|object]]s to sequences of [[bit]]s. It does not include [[markup language]]s used exclusively as [[document file format]]s.
==Overview==
{{sort-under}}
{{sticky table start}}
{| class="wikitable sortable sort-under sticky-table-head" style="font-size:75%"
|-
! Name
! Creator
! Based on
! Standardized?{{definition needed|date=January 2021}}<!-- A spec is a form of standardization. So what is this column representing? ISO-like standards? Then why are BEPs and PEPs valid? -->
! [[Specification]]
! [[Binary format|Binary]]?
! [[Human-readable]]?
! Supports [[reference (computer science)|reference]]s?{{ref|stdrefs|e}}
! Schema-[[interface description language|IDL]]?
! Standard [[API
! Supports [[zero-copy]] operations
|-
| [[Apache Arrow]]
| [[Apache Software Foundation]]
| {{n/a}}
| {{partial|''De facto''}}
| [https://arrow.apache.org/docs/format/Columnar.html Arrow Columnar Format]
| {{yes}}
| {{no}}
| {{yes}}
| {{yes|Built-in}}
| C, C++, C#, Go, Java, JavaScript, Julia, Matlab, Python, R, Ruby, Rust, Swift
| {{yes}}
|-
| [[Apache Avro]]
| [[Apache Software Foundation]]
| {{n/a}}
| {{no}}
| [https://avro.apache.org/docs/current/spec.html Apache Avro™ Specification]
| {{yes}}
| {{partial}}{{ref|avrojson|g}}
| {{n/a}}
| {{yes|Built-in}}
| C, C#, C++, Java, PHP, Python, Ruby
| {{n/a}}
|-
| [[Apache Parquet]]
| [[Apache Software Foundation]]
| {{n/a}}
| {{no}}
| [https://parquet.apache.org Apache Parquet]
| {{yes}}
| {{no}}
| {{no}}
| {{n/a}}
| Java, Python, C++
| {{no}}
|-
| [[Apache Thrift]]
| [[Facebook]] (creator)<br>[[Apache Software Foundation|Apache]] (maintainer)
| {{n/a}}
| {{no}}
| [http://thrift.apache.org/static/files/thrift-20070401.pdf Original whitepaper]
| {{yes}}
| {{partial}}{{ref|thrifttxt|c}}
| {{no}}
| {{yes|Built-in}}
| C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml, Delphi and other languages<ref>[https://thrift.apache.org/ Apache Thrift]</ref>
| {{n/a}}
|-
| [[ASN.1]]
| [[International Organization for Standardization|ISO]], [[International Electrotechnical Commission|IEC]], [[ITU-T]]
| {{n/a}}
| {{yes}}
| ISO/IEC 8824 / ITU-T X.680 (syntax) and ISO/IEC 8825 / ITU-T X.690 (encoding rules) series. X.680, X.681, and X.683 define syntax and semantics.
| {{yes|[[Basic Encoding Rules|BER]], [[Distinguished Encoding Rules|DER]], [[Packed Encoding Rules|PER]], [[Octet encoding rules|OER]], or custom via [[Encoding Control Notation|ECN]]}}
| {{yes|[[XML Encoding Rules|XER]], [[JSON encoding rules|JER]], [[Generic String Encoding Rules|GSER]], or custom via [[Encoding Control Notation|ECN]]}}
| {{yes}}{{ref|asn1refs|f}}
| {{yes|Built-in}}
| {{n/a}}
| {{yes|[[Octet encoding rules|OER]]}}
|-
| [[Bencode]]
| [[Bram Cohen]] (creator)<br>[[BitTorrent, Inc.]] (maintainer)
| {{n/a}}
| {{yes| ''De facto'' as {{abbr|BEP|BitTorrent Enhancement Proposal}}}}
| Part of [http://bittorrent.org/beps/bep_0003.html BitTorrent protocol specification]
| {{partial|Except numbers and delimiters, being ASCII}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
|-
| [[BSON]]
| [[MongoDB]]
| [[JSON]]
| {{no}}
| [http://bsonspec.org BSON Specification]
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
|-
| [[Cap%27n Proto]]
| Kenton Varda
| {{n/a}}
| {{no}}
| [https://capnproto.org/encoding.html Cap'n Proto Encoding Spec]
| {{yes}}
| {{partial}}{{ref|capnptextformat|h}}
| {{no}}
| {{yes}}
| {{no}}
| {{yes}}
|-
| [[CBOR]]
| Carsten Bormann, [[Paul Hoffman (engineer)|P. Hoffman]]
| [[MessagePack]]<ref>{{cite web|url=https://github.com/msgpack/msgpack/issues/258#issuecomment-449978394|title=CBOR relationship with msgpack|first1=Carsten|last1=Bormann|website=[[GitHub]] |date=2018-12-26|access-date=2023-08-14}}</ref>
| {{yes}}
| RFC 8949
| {{yes}}
| {{no}}
| {{yes}}, <br/>through tagging
| {{yes|[https://tools.ietf.org/html/rfc8610 CDDL]}}
| {{yes|[[FIDO_Alliance|FIDO2]]}}
| {{no}}
|-
| [[Comma-separated values]] (CSV)
| RFC author:<br>Yakov Shafranovich
| {{n/a}}
| {{partial|Myriad informal variants}}
| RFC 4180<br>(among others)
| {{no}}
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
|-
| [[Common Data Representation]] (CDR)
| [[Object Management Group]]
| {{n/a}}
| {{yes}}
| [[General Inter-ORB Protocol]]
| {{yes}}
| {{no}}
| {{yes}}
| {{yes}}
| Ada, C, C++, Java, Cobol, Lisp, Python, Ruby, Smalltalk
| {{n/a}}
|-
| [[D-Bus]] Message Protocol
| [[freedesktop.org]]
| {{n/a}}
| {{yes}}
| [https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol D-Bus Specification]
| {{yes}}
| {{no}}
| {{no}}
| {{partial}}<br>(Signature strings)
| {{yes|[[D-Bus|Yes]]}}
| {{n/a}}
|-
| [[Efficient XML Interchange]] (EXI)
| [[World Wide Web Consortium|W3C]]
| [[XML]], Efficient XML
| {{Yes}}
| [https://www.w3.org/TR/exi/ Efficient XML Interchange (EXI) Format 1.0]
| {{Yes}}
| {{yes|[[XML]]}}
| {{Yes|[[XPointer]], [[XPath]]}}
| {{Yes|[[XML Schema (W3C)|XML Schema]]}}
| {{Yes|[[Document Object Model|DOM]], [[Simple API for XML|SAX]], [[StAX]], [[XQuery]], [[XPath]]}}
| {{n/a}}
|-
| [[Extensible Data Notation]] (edn)
| [[Rich Hickey]] / Clojure community
| [[Clojure]]
| {{yes}}
| [https://github.com/edn-format/edn Official edn spec]
| {{no}}
| {{yes}}
| {{no}}
| {{no}}
| Clojure, Ruby, Go, C++, Javascript, Java, CLR, ObjC, Python<ref>{{cite web|url=https://github.com/edn-format/edn/wiki/Implementations|title=Implementations|website=[[GitHub]] }}</ref>
| {{no}}
|-
| [[FlatBuffers]]
| Google
| {{n/a}}
| {{no}}
| [https://google.github.io/flatbuffers/ Flatbuffers GitHub]
| {{yes}}
| {{yes|[[Apache Arrow]]}}
| {{partial}}<br>(internal to the buffer)
| {{yes|[https://google.github.io/flatbuffers/flatbuffers_guide_writing_schema.html Yes]}}
| C++, Java, C#, Go, Python, Rust, JavaScript, PHP, C, Dart, Lua, TypeScript
| {{yes}}
|-
| [[Fast Infoset]]
| [[International Organization for Standardization|ISO]], [[International Electrotechnical Commission|IEC]], [[ITU-T]]
| [[XML]]
| {{yes}}
| ITU-T X.891 and ISO/IEC 24824-1:2007
| {{yes}}
| {{no}}
| {{yes|[[XPointer]], [[XPath]]}}
| {{yes|[[XML schema]]}}
| {{yes|[[Document Object Model|DOM]], [[Simple API for XML|SAX]], [[XQuery]], [[XPath]]}}
| {{n/a}}
|-
| [[FHIR]]
| [[Health Level 7]]
| [[REST]] basics
| {{Yes}}
| [[Fast Healthcare Interoperability Resources]]
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| Hapi for FHIR<ref>{{cite web|url=http://hapifhir.io/|title=HAPI FHIR - The Open Source FHIR API for Java|website=hapifhir.io}}</ref> [[JSON]], [[XML]], [[Turtle (syntax)|Turtle]]
| {{no}}
|-
| [[Ion (serialization format)|Ion]]
| [[Amazon.com|Amazon]]
| [[JSON]]
| {{no}}
| [https://amzn.github.io/ion-docs/spec.html The Amazon Ion Specification]
| {{yes}}
| {{yes}}
| {{no}}
| {{Yes|[https://amzn.github.io/ion-schema/ Ion schema]}}
| C, C#, Go, Java, JavaScript, Python, Rust
| {{n/a}}
|-
| [[Java (programming language)|Java]] serialization
| [[Oracle Corporation]]
| {{n/a}}
| {{yes}}
| [https://docs.oracle.com/javase/8/docs/technotes/guides/serialization/index.html Java Object Serialization]
| {{yes}}
| {{no}}
| {{yes}}
| {{no}}
| {{yes}}
| {{n/a}}
|-
| [[JSON]]
| [[Douglas Crockford]]
| [[JavaScript syntax]]
| {{yes}}
| [https://tools.ietf.org/html/std90 STD 90]/RFC 8259<br>(ancillary:<br>RFC 6901,<br>RFC 6902), [http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf ECMA-404], [https://www.iso.org/standard/71616.html ISO/IEC 21778:2017]
| {{no}}, but see [[BSON]], [[Smile (data interchange format)|Smile]], [[UBJSON]]
| {{yes}}
| {{yes|[https://tools.ietf.org/html/rfc6901 JSON Pointer (RFC{{nbsp}}6901)], or alternately, [http://goessner.net/articles/JsonPath/ JSONPath], [https://web.archive.org/web/20120922110739/http://bluelinecity.com/software/jpath/ JPath], [https://web.archive.org/web/20121203081945/http://www.jspon.org/ JSPON], [https://github.com/lloyd/JSONSelect json:select()]; and [[JSON-LD]]}}
| {{partial}}<br>([http://json-schema.org/ JSON Schema Proposal], [[ASN.1]] with [[JSON encoding rules|JER]], [http://www.kuwata-lab.com/kwalify/ Kwalify] {{Webarchive|url=https://web.archive.org/web/20210812231831/http://www.kuwata-lab.com/kwalify/ |date=2021-08-12 }}, [http://rjbs.manxome.org/rx/ Rx], [[JSON-LD]]
| {{partial}}<br>([https://github.com/dscape/clarinet Clarinet], [https://www.sitepen.com/blog/jsonquery-data-querying-beyond-jsonpath JSONQuery] / [https://www.sitepen.com/blog/resource-query-language-a-query-language-for-the-web-nosql RQL], [http://goessner.net/articles/JsonPath/ JSONPath]), [[JSON-LD]]
| {{no}}
|-
| [[MessagePack]]
| Sadayuki Furuhashi
| [[JSON]] (loosely)
| {{no}}
| [https://github.com/msgpack/msgpack/blob/master/spec.md MessagePack format specification]
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
| {{yes}}
|-
| [[Netstring]]s
| [[Dan Bernstein]]
| {{n/a}}
| {{no}}
| [http://cr.yp.to/proto/netstrings.txt netstrings.txt]
| {{partial|Except ASCII delimiters}}
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
| {{yes}}
|-
| [[OGDL]]
| Rolf Veen
| {{dunno}}
| {{no}}
| [http://ogdl.org/spec/ Specification]
| {{yes|[http://ogdl.org/spec/binary.html Binary specification]}}
| {{yes}}
| {{yes|[http://ogdl.org/spec/path.html Path specification]}}
| {{yes|[http://ogdl.org/spec/schema.html Schema WD]}}
|
| {{n/a}}
|-
| [[OPC Unified Architecture|OPC-UA Binary]]
| [[OPC Foundation]]
| {{n/a}}
| {{no}}
| [https://opcfoundation.org opcfoundation.org]
| {{yes}}
| {{no}}
| {{yes}}
| {{no}}
| {{no}}
| {{n/a}}
|-
| [[OpenDDL]]
| [[Eric Lengyel]]
| [[C (programming language)|C]], [[PHP]]
| {{no}}
| [http://openddl.org/ OpenDDL.org]
| {{no}}
| {{yes}}
| {{yes}}
| {{no}}
| {{yes|[http://openddl.org/ OpenDDL library]}}
| {{n/a}}
|-
| [[PHP serialization format]]
| PHP Group
| {{n/a}}
| {{yes}}
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
| {{no}}
| {{yes}}
| {{n/a}}
|-
| [[Pickle (Python)]]
| [[Guido van Rossum]]
| [[Python (programming language)|Python]]
| {{yes|''De facto'' as [[Python Enhancement Proposal|PEP]]s}}
| [https://www.python.org/dev/peps/pep-3154/ PEP 3154 – Pickle protocol version 4]
| {{yes}}
| {{no}}
| {{yes}}<ref>[https://github.com/python/cpython/blob/v3.9.0/Lib/pickle.py#L137-L144 cpython/Lib/pickle.py]</ref>
| {{no}}
| {{yes}}
| {{no}}
|-
| [[Property list]]
| [[NeXT]] (creator)<br
| {{dunno}}
| {{partial}}
| [https://www.apple.com/DTDs/PropertyList-1.0.dtd Public DTD for XML format]
| {{yes}}{{ref|plbin|a}}
| {{yes}}{{ref|pltxt|b}}
| {{no}}
| {{dunno}}
| [https://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html Cocoa], [https://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFPropertyLists/CFPropertyLists.html CoreFoundation], [https://web.archive.org/web/20081210064322/http://docs.sun.com/app/docs/doc/802-2112/6i63mn65o?a=view OpenStep], [https://web.archive.org/web/20110519164921/http://gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html GnuStep]
| {{no}}
|-
| [[Protocol Buffers]] (protobuf)
| [[Google]]
| {{n/a}}
| {{no}}
| [https://developers.google.com/protocol-buffers/docs/encoding Developer Guide: Encoding], [https://developers.google.com/protocol-buffers/docs/reference/proto2-spec proto2 specification], and [https://developers.google.com/protocol-buffers/docs/reference/proto3-spec proto3 specification]
| {{yes}}
| {{yes}}{{ref|pbtextformat|d}}
| {{no}}
| {{yes|Built-in}}
| C++, Java, C#, Python, Go, Ruby, Objective-C, C, Dart, Perl, PHP, R, Rust, Scala, Swift, Julia, Erlang, D, Haskell, ActionScript, Delphi, Elixir, Elm, Erlang, GopherJS, Haskell, Haxe, JavaScript, Kotlin, Lua, Matlab, Mercurt, OCaml, Prolog, Solidity, Typescript, Vala, Visual Basic
| {{no}}
|-
| {{nobr|[[S-expression]]s}}
|
| [[Lisp (programming language)|Lisp]], [[Netstring]]s
| {{partial|Largely ''de facto''}}
| [http://people.csail.mit.edu/rivest/Sexp.txt "S-Expressions"] {{Webarchive|url=https://web.archive.org/web/20131007024815/http://people.csail.mit.edu/rivest/Sexp.txt |date=2013-10-07 }} [[Internet Draft]]
| {{yes}}, ''canonical representation''
| {{yes}}, ''advanced transport representation''
| {{no}}
| {{no}}
|
| {{n/a}}
|-
| [[
| Tatu Saloranta
| [[JSON]]
| {{no}}
| [https://github.com/FasterXML/smile-format-specification Smile Format Specification]
| {{yes}}
| {{no}}
| {{yes}}
| {{partial}}<br>([http://json-schema.org/ JSON Schema Proposal], other JSON schemas/IDLs)
| {{partial}}<br>(via JSON APIs implemented with Smile backend, on Jackson, Python)
| {{n/a}}
|-
| [[SOAP]]
| [[W3C]]
| [[XML]]
| {{yes}}
| {{nobr|[[W3C Recommendation]]s:}}<br>[https://www.w3.org/TR/2000/NOTE-SOAP-20000508/ SOAP/1.1]<br>[https://www.w3.org/TR/soap12/ SOAP/1.2]
| {{partial}}<br>({{nobr|[[Efficient XML Interchange]]}}, {{nobr|[[Binary XML]]}}, {{nobr|[[Fast Infoset]]}}, [[Message Transmission Optimization Mechanism|MTOM]], {{nobr|[[XSD]] base64 data}})
| {{yes}}
| {{yes|Built-in id/ref, [[XPointer]], [[XPath]]}}
| {{yes|[[WSDL]], [[XML schema]]}}
| {{yes|[[Document Object Model|DOM]], [[Simple API for XML|SAX]], [[XQuery]], [[XPath]]}}
| {{n/a}}
|-
| {{nobr|[[SDXF|Structured Data eXchange Format]]s}}
| [[Max Wildgrube]]
| {{n/a}}
| {{yes}}
| RFC 3072
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
|
| {{n/a}}
|-
| [[UBJSON]]
| The Buzz Media, LLC
| [[JSON]], [[BSON]]
| {{no}}
| [http://ubjson.org/ ubjson.org]
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
| {{n/a}}
|-
| [[External Data Representation|eXternal Data Representation]] (XDR)
| [[Sun Microsystems]] (creator)<br>[[IETF]] (maintainer)
| {{n/a}}
| {{yes}}
| [https://tools.ietf.org/html/std67 STD 67]/RFC 4506
| {{yes}}
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
| {{n/a}}
|-
| [[XML]]
| [[W3C]]
| [[SGML]]
| {{yes}}
| {{nobr|[[W3C Recommendation]]s:}}<br>[http://www.w3.org/TR/2008/REC-xml-20081126/ 1.0 (Fifth Edition)]<br>[http://www.w3.org/TR/2006/REC-xml11-20060816/ 1.1 (Second Edition)]
| {{partial}}<br>({{nobr|[[Efficient XML Interchange]]}}, {{nobr|[[Binary XML]]}}, {{nobr|[[Fast Infoset]]}}, {{nobr|[[XSD]] base64 data}})
| {{yes}}
| {{yes|[[XPointer]], [[XPath]]}}
| {{yes|[[XML schema]], [[RELAX NG]]}}
| {{yes|[[Document Object Model|DOM]], [[Simple API for XML|SAX]], [[XQuery]], [[XPath]]}}
| {{n/a}}
|-
| [[XML-RPC]]
| [[Dave Winer]]<ref name="xmlrpc-hist">{{cite web|url=https://www.xml.com/pub/a/ws/2001/04/04/soap.html|title=A Brief History of SOAP|website=www.xml.com}}</ref>
| [[XML]]
| {{no}}
| [http://xmlrpc.com/spec.md XML-RPC Specification]
| {{no}}
| {{yes}}
| {{no}}
| {{no}}
| {{no}}
| {{no}}
|-
| [[YAML]]
| Clark Evans,<br>Ingy döt Net,<br>and Oren Ben-Kiki
| [[C (programming language)|C]], [[Java (programming language)|Java]], [[Perl]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Email]], [[HTML]], [[MIME]], [[URI]], [[XML]], [[Simple API for XML|SAX]], [[SOAP]], [[JSON]]<ref>{{cite web|url=http://yaml.org/spec/1.2/spec.html#id2708710|title=YAML Ain't Markup Language (YAML) Version 1.2|first1=Oren |last1=Ben-Kiki |first2=Clark |last2=Evans |first3=Ingy döt |last3=Net|date=2009-10-01|work=The Official YAML Web Site|access-date=2012-02-10}}</ref>
| {{no}}
| [http://www.yaml.org/spec/1.2/spec.html Version 1.2]
| {{no}}
| {{yes}}
| {{yes}}
| {{partial}}<br>([http://www.kuwata-lab.com/kwalify/ Kwalify] {{Webarchive|url=https://web.archive.org/web/20210812231831/http://www.kuwata-lab.com/kwalify/ |date=2021-08-12 }}, [http://rjbs.manxome.org/rx/ Rx], built-in language type-defs)
| {{no}}
| {{no}}
|-
! Name
! Creator-maintainer
! Based on
! Standardized?
! [[Specification]]
! [[Binary format|Binary]]?
! [[Human-readable]]?
! Supports [[reference (computer science)|reference]]s?{{ref|stdrefs|e}}
! Schema-[[interface description language|IDL]]?
! Standard [[API]]s
! Supports [[zero-copy]] operations
|}
{{sticky table end}}
{{ordered list
| list-style-type=lower-alpha
| {{note|plbin}}The current default format is binary.
| {{note|pltxt}}The "classic" format is plain text, and an XML format is also supported.
| {{note|thrifttxt}}Theoretically possible due to abstraction, but no implementation is included.
| {{note|pbtextformat}}The primary format is binary, but text and JSON formats are available.<ref>{{cite web|url=https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.text_format|title=text_format.h - Protocol Buffers|website=Google Developers}}</ref><ref>{{cite web|url=https://developers.google.com/protocol-buffers/docs/proto3#json|title=JSON Mapping - Protocol Buffers|website=Google Developers}}</ref>
| {{note|stdrefs}}Means that generic tools/libraries know how to encode, decode, and dereference a reference to another piece of data in the same document. A tool may require the [[Interface description language|IDL]] file, but no more. Excludes custom, non-standardized referencing techniques.
| {{note|asn1refs}}ASN.1 has X.681 (Information Object System), X.682 (Constraints), and X.683 (Parameterization) that allow for the precise specification of open types where the types of values can be identified by integers, by [[Object identifier|OIDs]], etc. OIDs are a standard format for globally unique identifiers, as well as a standard notation ("absolute reference") for referencing a component of a value. For example, PKIX uses such notation in RFC 5912. With such notation (constraints on parameterized types using information object sets), generic ASN.1 tools/libraries can automatically encode/decode/resolve references within a document.
| {{note|avrojson}}The primary format is binary, a json encoder is available.<ref>{{cite web|url=https://avro.apache.org/docs/1.9.2/spec.html#json_encoding|title=Avro Json Format}}</ref>
| {{note|capnptextformat}}The primary format is binary, but a text format is available.
}}
==Syntax comparison of human-readable formats==
{{sticky table start}}
{| class="wikitable sortable sort-under sticky-table-head" style="font-size:75%"
|-
! Format
! [[Nullable type|Null]]
! [[Boolean data type|Boolean]] true
! [[Boolean data type|Boolean]] false
! [[Integer (computer science)|Integer]]
! [[Floating-point]]
! [[String (computer science)|String]]
! [[Array data type|Array]]
! [[Associative array]]/[[Object (computer science)|Object]]
|-
| [[XML Encoding Rules|ASN.1]]<br>(XML Encoding Rules)
| {{nobr|<code><foo /></code>}}
| <code><foo>true</foo></code>
| <code><foo>false</foo></code>
| <code><foo>685230</foo></code>
| <code><foo>6.8523015e+5</foo></code>
| {{nobr|<code><foo>A to Z</foo></code>}}
| <syntaxhighlight lang="xml"><SeqOfUnrelatedDatatypes>
<isMarried>true</isMarried>
<hobby />
<velocity>-42.1e7</velocity>
<bookname>A to Z</bookname>
<bookname>We said, "no".</bookname>
</SeqOfUnrelatedDatatypes></syntaxhighlight>
| An object (the key is a field name):
<syntaxhighlight lang="xml"><person>
<isMarried>true</isMarried>
<hobby />
<height>1.85</height>
<name>Bob Peterson</name>
</person></syntaxhighlight>
A data mapping (the key is a data value):
<syntaxhighlight lang="xml"><competition>
<measurement>
<name>John</name>
<height>3.14</height>
</measurement>
<measurement>
<name>Jane</name>
<height>2.718</height>
</measurement>
</competition></syntaxhighlight>
{{ref|guess|a}}
|-
| [[Comma-separated values|CSV]]{{ref|csvguess|b}}
| <code>null</code>{{ref|guess|a}}<br>(or an empty element in the row){{ref|guess|a}}
| <code>1</code>{{ref|guess|a}}<br><code>true</code>{{ref|guess|a}}
| <code>0</code>{{ref|guess|a}}<br><code>false</code>{{ref|guess|a}}
| <code>685230</code><br><code>-685230</code>{{ref|guess|a}}
| <code>6.8523015e+5</code>{{ref|guess|a}}
| {{nobr|<code>A to Z</code>}}<br><code>{{nobr|"We said, ""no""."}}</code>
| <code>true,,-42.1e7,"A to Z"</code>
| <pre>42,1
A to Z,1,2,3</pre>
|-
| [[Extensible Data Notation|edn]]
| <code>nil</code>
| <code>true</code>
| <code>false</code>
| <code>685230</code><br><code>-685230</code>
| <code>6.8523015e+5</code>
| <code>"A to Z"</code>, <code>"A \"up to\" Z"</code>
| <code>[true nil -42.1e7 "A to Z"]</code>
| <code>{:kw 1, "42" true, "A to Z" [1 2 3]}</code>
|-
| [[Ion (Serialization format)|Ion]]
|
<code>null</code><br />
<code>null.null</code><br />
<code>null.bool</code><br />
<code>null.int</code><br />
<code>null.float</code><br />
<code>null.decimal</code><br />
<code>null.timestamp</code><br />
<code>null.string</code><br />
<code>null.symbol</code><br />
<code>null.blob</code><br />
<code>null.clob</code><br />
<code>null.struct</code><br />
<code>null.list</code><br />
<code>null.sexp</code>
| <code>true</code>
| <code>false</code>
| <code>685230</code><br><code>-685230</code><br /><code>0xA74AE</code><br /><code>0b111010010101110</code>
| <code>6.8523015e5</code>
| <code>"A to Z"</code><br><br><code><nowiki>'''</nowiki><br>A <br>to <br>Z<br><nowiki>'''</nowiki></code>
|<syntaxhighlight lang="json">
[true, null, -42.1e7, "A to Z"]
</syntaxhighlight>
|<syntaxhighlight lang="javascript">
{'42': true, 'A to Z': [1, 2, 3]}
</syntaxhighlight>
|-
| [[Netstring]]s{{ref|netguess|c}}
| <code>0:,</code>{{ref|guess|a}}<br><code>4:null,</code>{{ref|guess|a}}
| <code>1:1,</code>{{ref|guess|a}}<br><code>4:true,</code>{{ref|guess|a}}
| <code>1:0,</code>{{ref|guess|a}}<br><code>5:false,</code>{{ref|guess|a}}
| <code>6:685230,</code>{{ref|guess|a}}
| <code>9:6.8523e+5,</code>{{ref|guess|a}}
| {{nobr|<code>6:A to Z,</code>}}
| <code>29:4:true,0:,7:-42.1e7,6:A to Z,,</code>
| {{nobr|<code>41:9:2:42,1:1,,25:6:A to Z,12:1:1,1:2,1:3,,,,</code>}}{{ref|guess|a}}
|-
| [[JSON]]
| <code>null</code>
| <code>true</code>
| <code>false</code>
| <code>685230</code><br><code>-685230</code>
| <code>6.8523015e+5</code>
| {{nobr|<code>"A to Z"</code>}}
|<syntaxhighlight lang="json">
[true, null, -42.1e7, "A to Z"]
</syntaxhighlight>
|<syntaxhighlight lang="json">
{"42": true, "A to Z": [1, 2, 3]}
</syntaxhighlight>
|-
| [[OGDL]]{{Verify source|date=September 2009}}
| <code>null</code>{{ref|guess|a}}
| <code>true</code>{{ref|guess|a}}
| <code>false</code>{{ref|guess|a}}
| <code>685230</code>{{ref|guess|a}}
| <code>6.8523015e+5</code>{{ref|guess|a}}
| <code>"A to Z"</code><br><code>'A to Z'</code><br><code>NoSpaces</code>
| <pre>true
null
-42.1e7
"A to Z"</pre>
<code>(true, null, -42.1e7, "A to Z")</code>
|<pre>42
true
"A to Z"
1
2
3</pre>
<pre>42
true
"A to Z", (1, 2, 3)</pre>
|-
| [[OpenDDL]]
| <code>ref {null}</code>
| <code>bool {true}</code>
| <code>bool {false}</code>
| <code>int32 {685230}</code><br/><code>int32 {0x74AE}</code><br/><code>int32 {0b111010010101110}</code>
| <code>float {6.8523015e+5}</code>
| <code>string {"A to Z"}</code>
| Homogeneous array:
<pre>int32 {1, 2, 3, 4, 5}</pre>
Heterogeneous array:
<pre>array
{
bool {true}
ref {null}
float {-42.1e7}
string {"A to Z"}
}</pre>
| <pre>dict
{
value (key = "42") {bool {true}}
value (key = "A to Z") {int32 {1, 2, 3}}
}</pre>
|-
|[[PHP serialization format]]
|<code>N;</code>
|<code>b:1;</code>
|<code>b:0;</code>
|<code>i:685230;</code><br><code>i:-685230;</code>
|<code>d:685230.15;</code>{{ref|phpfloat|d}}<br><code>d:INF;</code><br><code>d:-INF;</code><br><code>d:NAN;</code>
|<code>s:6:"A to Z";</code>
|<code>a:4:{i:0;b:1;i:1;N;i:2;d:-421000000;i:3;s:6:"A to Z";}</code>
|Associative array:<br><code>a:2:{i:42;b:1;s:6:"A to Z";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}</code><br>Object:<br><code>O:8:"stdClass":2:{s:4:"John";d:3.14;s:4:"Jane";d:2.718;}</code>{{ref|phpfloat|d}}
|-
| [[Pickle (Python)]]
| <code>N.</code>
| <code>I01\n.</code>
| <code>I00\n.</code>
| <code>I685230\n.</code>
| <code>F685230.15\n.</code>
| <code>S'A to Z'\n.</code>
| <code>(lI01\na(laF-421000000.0\naS'A to Z'\na.</code>
| <code>(dI42\nI01\nsS'A to Z'\n(lI1\naI2\naI3\nas.</code>
|-
| [[Property list]]<br>(plain text format)<ref name="gnustep">{{cite web|url=http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html|title=NSPropertyListSerialization class documentation|website=www.gnustep.org|access-date=2009-10-28|archive-url=https://web.archive.org/web/20110519164921/http://gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html|archive-date=2011-05-19|url-status=dead}}</ref>
| {{n/a}}
| <code><*BY></code>
| <code><*BN></code>
| <code><*I685230></code>
| <code><*R6.8523015e+5></code>
| <code>"A to Z"</code>
| <code>( <*BY>, <*R-42.1e7>, "A to Z" )</code>
| <pre>{
"42" = <*BY>;
"A to Z" = ( <*I1>, <*I2>, <*I3> );
}</pre>
|-
| [[Property list]]<br>(XML format)<ref>{{cite web|url=https://developer.apple.com/library/archive/|title=Documentation Archive|website=developer.apple.com}}</ref>
| {{n/a}}
| <code><true /></code>
| <code><false /></code>
| <code><integer>685230</integer></code>
| <code><real>6.8523015e+5</real></code>
| {{nobr|<code><string>A to Z</string></code>}}
| <syntaxhighlight lang="xml"><array>
<true />
<real>-42.1e7</real>
<string>A to Z</string>
</array></syntaxhighlight>
| <syntaxhighlight lang="xml"><dict>
<key>42</key>
<true />
<key>A to Z</key>
<array>
<integer>1</integer>
<integer>2</integer>
<integer>3</integer>
</array>
</dict></syntaxhighlight>
|-
| [[Protocol Buffers]]
| {{n/a}}
| <code>true</code>
| <code>false</code>
| <code>685230</code><br><code>-685230</code>
| <code>20.0855369</code>
| <code>{{nobr|"A to Z"}}<br>{{nobr|"sdfff2 \000\001\002\377\376\375"}}<br>{{nobr|"q\tqq<>q2&\001\377"}}</code>
| <pre>field1: "value1"
field1: "value2"
field1: "value3
</pre>
<pre>anotherfield {
foo: 123
bar: 456
}
anotherfield {
foo: 222
bar: 333
}
</pre>
| <syntaxhighlight lang="protobuf">
thing1: "blahblah"
thing2: 18923743
thing3: -44
thing4 {
submessage_field1: "foo"
submessage_field2: false
}
enumeratedThing: SomeEnumeratedValue
thing5: 123.456
[extensionFieldFoo]: "etc"
[extensionFieldThatIsAnEnum]: EnumValue
</syntaxhighlight>
|-
| [[S-expression]]s
| <code>NIL</code><br><code>nil</code>
| <code>T</code><br><code>#t</code>{{ref|lispstd|f}}<br><code>true</code>
| <code>NIL</code><br><code>#f</code>{{ref|lispstd|f}}<br><code>false</code>
| <code>685230</code>
| <code>6.8523015e+5</code>
| <code>abc</code><br><code>"abc"</code><br><code>#616263#</code><br><code>3:abc</code><br><code>{MzphYmM=}</code><br><code><nowiki>|YWJj|</nowiki></code>
| <code>(T NIL -42.1e7 "A to Z")</code>
| <code>((42 T) ("A to Z" (1 2 3)))</code>
|-
| [[YAML]]
| <code>~</code><br><code>null</code><br><code>Null</code><br><code>NULL</code><ref>{{cite web|url=http://yaml.org/type/null.html |title=Null Language-Independent Type for YAML Version 1.1 |work=YAML.org
|date=2005-01-18 |author1=Oren Ben-Kiki|author2=Clark Evans|author3=Brian Ingerson |access-date=2009-09-12}}</ref>
| <code>y</code><br><code>Y</code><br><code>yes</code><br><code>Yes</code><br><code>YES</code><br><code>on</code><br><code>On</code><br><code>ON</code><br><code>true</code><br><code>True</code><br><code>TRUE</code><ref name="yamlbool">{{cite web|url=http://yaml.org/type/bool.html |title=Boolean Language-Independent Type for YAML Version 1.1 |publisher=Clark C. Evans |author1=Oren Ben-Kiki|author2=Clark Evans|author3=Brian Ingerson |work=YAML.org |date=2005-01-18 |access-date=2009-09-12}}</ref>
| <code>n</code><br><code>N</code><br><code>no</code><br><code>No</code><br><code>NO</code><br><code>off</code><br><code>Off</code><br><code>OFF</code><br><code>false</code><br><code>False</code><br><code>FALSE</code><ref name="yamlbool"/>
| <code>685230</code><br><code>+685_230</code><br><code>-685230</code><br><code>02472256</code><br><code>0x_0A_74_AE</code><br><code>0b1010_0111_0100_1010_1110</code><br><code>190:20:30</code><ref>{{cite web|url=http://yaml.org/type/int.html |title=Integer Language-Independent Type for YAML Version 1.1 |publisher=Clark C. Evans |author1=Oren Ben-Kiki|author2=Clark Evans|author3=Brian Ingerson |work=YAML.org |date=2005-02-11 |access-date=2009-09-12}}</ref>
|<code>6.8523015e+5</code><br><code>685.230_15e+03</code><br><code>685_230.15</code><br><code>190:20:30.15</code><br><code>.inf</code><br><code>-.inf</code><br><code>.Inf</code><br><code>.INF</code><br><code>.NaN</code><br><code>.nan</code><br><code>.NAN</code><ref>{{cite web|url=http://yaml.org/type/float.html |title=Floating-Point Language-Independent Type for YAML Version 1.1 |publisher=Clark C. Evans |author1=Oren Ben-Kiki|author2=Clark Evans|author3=Brian Ingerson |work=YAML.org |date=2005-01-18 |access-date=2009-09-12}}</ref>
| <code>A to Z</code><br><code>"A to Z"</code><br><code>'A to Z'</code>
| <code>[y, ~, -42.1e7, "A to Z"]</code>
<pre>- y
-
- -42.1e7
- A to Z</pre>
| <code>{"John":3.14, "Jane":2.718}</code>
<pre>42: y
A to Z: [1, 2, 3]</pre>
|-
| [[XML]]{{ref|xmlguess|e}} and [[SOAP]]
| {{nobr|<code><null /></code>{{ref|guess|a}}}}
| <code>true</code>
| <code>false</code>
| <code>685230</code>
| <code>6.8523015e+5</code>
| {{nobr|<code>A to Z</code>}}
|<syntaxhighlight lang="xml">
<item>true</item>
<item xsi:nil="true"/>
<item>-42.1e7</item>
<item>A to Z<item>
</syntaxhighlight>
|<syntaxhighlight lang="xml"><map>
<entry key="42">true</entry>
<entry key="A to Z">
<item val="1"/>
<item val="2"/>
<item val="3"/>
</entry>
</map></syntaxhighlight>
|-
| [[XML-RPC]]
|
| <code><value><boolean>1</boolean></value></code>
| <code><value><boolean>0</boolean></value></code>
| <code><value><int>685230</int></value></code>
| <code><value><double>6.8523015e+5</double></value></code>
| <code><value><string>A to Z</string></value></code>
|<syntaxhighlight lang="xml"><value><array>
<data>
<value><boolean>1</boolean></value>
<value><double>-42.1e7</double></value>
<value><string>A to Z</string></value>
</data>
</array></value></syntaxhighlight>
|<syntaxhighlight lang="xml"><value><struct>
<member>
<name>42</name>
<value><boolean>1</boolean></value>
</member>
<member>
<name>A to Z</name>
<value>
<array>
<data>
<value><int>1</int></value>
<value><int>2</int></value>
<value><int>3</int></value>
</data>
</array>
</value>
</member>
</struct></syntaxhighlight>
|}
{{sticky table end}}
{{ordered list
| list-style-type=lower-alpha
| {{note|guess}}Omitted XML elements are commonly decoded by [[XML data binding]] tools as NULLs. Shown here is another possible encoding; [[XML schema]] does not define an encoding for this datatype.
| {{note|csvguess}}The RFC CSV specification only deals with delimiters, newlines, and quote characters; it does not directly deal with serializing programming [[data structure]]s.
| {{note|netguess}}The [[netstring]]s specification only deals with nested [[byte string]]s; anything else is outside the scope of the specification.
| {{note|phpfloat}}PHP will unserialize any floating-point number correctly, but will serialize them to their full decimal expansion. For example, 3.14 will be serialized to {{val|3.140000000000000124344978758017532527446746826171875}}.
| {{note|xmlguess}}[[XML data binding]]s and [[SOAP]] serialization tools provide type-safe XML serialization of programming [[data structure]]s into XML. Shown are XML values that can be placed in XML elements and attributes.
| {{note|lispstd}}This syntax is not compatible with the Internet-Draft, but is used by some dialects of [[Lisp (programming language)|Lisp]].
}}
==Comparison of binary formats==
<!--This table is meant to describe how the various datatypes are encoded in binary in the various formats.-->
{{sticky table start}}
{| class="wikitable sortable sort-under sticky-table-head sticky-table-col1" style="font-size:75%"
|- style="vertical-align:bottom;"
! Format
! [[Nullable type|Null]]
! [[Boolean data type|Boolean]]s
! [[Integer (computer science)|Integer]]
! [[Floating-point]]
! [[String (computer science)|String]]
! [[Array (data type)|Array]]
! [[Associative array]]/[[object (computer science)|object]]
|- style="vertical-align:top;"
| [[ASN.1]]<br>([[Basic Encoding Rules|BER]], [[Packed Encoding Rules|PER]] or [[Octet encoding rules|OER]] encoding)
| {{mono|NULL}} type
| {{mono|BOOLEAN}}: {{ubli
| BER: as 1 byte in binary form;
| PER: as 1 bit;
|
}}
| {{mono|INTEGER}}: {{ubli
| BER: variable-length big-endian binary representation (up to 2{{sup|2{{sup|1024}}}} bits);
| PER Unaligned: a fixed number of bits if the integer type has a finite range; a variable number of bits otherwise;
| PER Aligned: a fixed number of bits if the integer type has a finite range and the size of the range is less than 65536; a variable number of octets otherwise;
| OER: 1, 2, or 4 octets (either signed or unsigned) if the integer type has a finite range that fits in that number of octets; a variable number of octets otherwise
}}
| {{mono|REAL}}:{{ubli
| base-10 real values are represented as character strings in ISO 6093 format;
| binary real values are represented in a binary format that includes the mantissa, the base (2, 8, or 16), and the exponent;
| the special values {{mono|NaN, -INF, +INF}}, and negative zero are also supported
}}
| Multiple valid types ({{mono|VisibleString, PrintableString, GeneralString, UniversalString, UTF8String}})
| Data specifications {{mono|SET OF}} (unordered) and {{mono|SEQUENCE OF}} (guaranteed order)
| User definable type
|- style="vertical-align:top;"
| [[BSON]]
| <code>\x0A</code><br>(1 byte)
| True: <code>\x08\x01</code><br>False: <code>\x08\x00</code><br>(2 bytes)
| int32: 32-bit [[little-endian]] [[2's complement]] or int64: 64-bit [[little-endian]] [[2's complement]]
| [[Double-precision floating-point format|Double]]: [[little-endian]] [[binary64]]
| [[UTF-8]]-encoded, preceded by int32-encoded string length in bytes
| [[BSON]] embedded document with numeric keys
| [[BSON]] embedded document
|- style="vertical-align:top;"
| [[CBOR|Concise Binary Object Representation]] (CBOR)
| <code>\xf6</code><br>(1 byte)
| {{ubli
| True: <code>\xf5</code>
| False: <code>\xf4</code>
}}
(1 byte)
| {{ubli
| Small positive/negative <code>\x00</code>–<code>\x17</code> & <code>\x20</code>–<code>\x37</code> (1 byte)
| 8-bit: positive <code>\x18</code>, negative <code>\x38</code> (+ 1 byte)
| 16-bit: positive <code>\x19</code>, negative <code>\x39</code> (+ 2 bytes)
| 32-bit: positive <code>\x1A</code>, negative <code>\x3A</code> (+ 4 bytes)
| 64-bit: positive <code>\x1B</code>, negative <code>\x3B</code> (+ 8 bytes)
| Negative x encoded as (−x − 1)
}}
| {{ubli
| IEEE half/single/double <code>\xf9</code>–<code>\xfb</code> (+ 2–8 bytes)
| Decimals and bigfloats (4+ bytes) encoded as <code>\xc4</code> tag + 2-item array of integer mantissa & exponent
}}
| {{ubli
| Length and content (1–9 bytes overhead)
| Bytestring <code>\x40</code>–<code>\x5f</code>
| [[UTF-8]] <code>\x60</code>–<code>\x7f</code>
| Indefinite partial strings <code>\x5f</code> and <code>\x7f</code> stitched together until <code>\xff</code>.
}}
| {{ubli
| Length and items <code>\x80</code>–<code>\x9e</code>
| Indefinite list <code>\x9f</code> terminated by <code>\xff</code> entry.
}}
| {{ubli
| Length (in pairs) and items <code>\xa0</code>–<code>\xbe</code>
| Indefinite map <code>\xbf</code> terminated by <code>\xff</code> key.
}}
|- style="vertical-align:top;"
| [[Efficient XML Interchange|Efficient XML Interchange (EXI)]]{{efn |group=binary |Any XML based representation can be compressed, or generated as, using EXI {{ndash}} {{Cite web |title=Efficient XML Interchange (EXI) Format 1.0 (Second Edition) |url=https://www.w3.org/TR/2014/REC-exi-20140211/Overview.html}}<ref>{{Cite web |title=Efficient Extensible Interchange |url=https://www.w3.org/XML/EXI/index.html}}</ref> {{ndash}} which is a "Schema Informed" (as opposed to schema-required, or schema-less) binary compression standard for XML.}}<br>
(Unpreserved lexical values format)
| xsi:nil is not allowed in binary context.
| 1–2 bit integer interpreted as boolean.
| Boolean sign, plus arbitrary length 7-bit octets, parsed until most-significant bit is 0, in little-endian. The schema can set the zero-point to any arbitrary number.<br>
Unsigned skips the boolean flag.
| {{ubli
| Float: integer mantissa and integer exponent.
| Decimal: boolean sign, integer whole value, integer fractional.
}}
| Length prefixed integer-encoded Unicode. Integers may represent enumerations or string table entries instead.
| Length prefixed set of items.
| {{No|Not in protocol.}}
|- style="vertical-align:top;"
| [[FlatBuffers]]
| Encoded as absence of field in parent object
| {{ubli
| True: <code>\x01</code>
| False: <code>\x00</code>
}}
(1 byte)
| [[Little-endian]] [[2's complement]] signed and unsigned 8/16/32/64 bits
| {{ubli
| [[Single-precision floating-point format|Floats]]: [[little-endian]] [[binary32]]
| [[Double-precision floating-point format|Doubles]]: [[little-endian]] [[binary64]]
}}
| [[UTF-8]]-encoded, preceded by 32-bit integer length of string in bytes
| Vectors of any other type, preceded by 32-bit integer length of number of elements
| Tables (schema defined types) or Vectors sorted by key (maps / dictionaries)
|- style="vertical-align:top;"
| [[Ion (serialization format)|Ion]]<ref>[http://amzn.github.io/ion-docs/docs/binary.html Ion Binary Encoding]</ref>
| <code>\x0f</code>{{efn |group=binary |All basic Ion types have a null variant, as its 0xXf tag. Any tag beginning with 0x0X other than 0x0f defines ignored padding.}}
| {{ubli
| True: <code>\x11</code>
| False: <code>\x10</code>
}}
| {{ubli
| Positive <code>\x2x</code>, negative <code>\x3x</code>
| Zero is always encoded in tag byte.
| BigInts over 13 bytes (104 bits) have 1+ byte overhead for length
}}
| {{ubli
| <code>\x44</code> (32-bit float)
| <code>\x48</code> (64-bit float)
| Zero is always encoded in tag byte.
}}
| {{ubli
| [[UTF-8]]: <code>\x8x</code>
| Other strings: <code>\x9x</code>
| Arbitrary length and overhead
}}
| <code>\xbx</code> Arbitrary length and overhead. Length in octets.
| {{ubli
| Structs (numbered fields): <code>\xdx</code>
| Annotations (named fields): <code>\xex</code>
}}
|- style="vertical-align:top;"
| [[MessagePack]]
| <code>\xc0</code>
| {{ubli
| True: <code>\xc3</code>
| False: <code>\xc2</code>
}}
| {{ubli
| Single byte "fixnum" (values {{nowrap|−32 – 127}})
| ''or'' typecode (1 byte) + big-endian (u)int8/16/32/64
}}
| Typecode (1 byte) + IEEE single/double
| {{ubli
| Typecode + up to 15 bytes
| ''or'' typecode + length as uint8/16/32 + bytes;
}}
encoding is unspecified<ref>{{cite web|url=https://github.com/msgpack/msgpack|title=MessagePack is an extremely efficient object serialization library. It's like JSON, but very fast and small.: msgpack/msgpack|date=2 April 2019|via=GitHub}}</ref>
| {{ubli
| As "fixarray" (single-byte prefix + up to 15 array items)
| ''or'' typecode (1 byte) + 2–4 bytes length + array items
}}
| {{ubli
| As "fixmap" (single-byte prefix + up to 15 key-value pairs)
| ''or'' typecode (1 byte) + 2–4 bytes length + key-value pairs
}}
|- style="vertical-align:top;"
| [[Netstring]]s{{efn |group=binary |Interpretation of Netstrings is entirely application- or schema-dependent.}}
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
| Length-encoded as an ASCII string + ':' + data + ','<br>
Length counts only octets between ':' and ','
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
|- style="vertical-align:top;"
| [[OGDL]] Binary
|
|
|
|
|
|
|
|- style="vertical-align:top;"
| [[Property list]]<br>(binary format)
|
|
|
|
|
|
|
|- style="vertical-align:top;"
| [[Protocol Buffers]]
|
|
| {{ubli
| Variable encoding length signed 32-bit: varint encoding of "ZigZag"-encoded value <code>(n << 1) [[XOR]] (n >> 31)</code>
| Variable encoding length signed 64-bit: varint encoding of "ZigZag"-encoded <code>(n << 1) XOR (n >> 63)</code>
| Constant encoding length 32-bit: 32 bits in [[little-endian]] [[2's complement]]
| Constant encoding length 64-bit: 64 bits in [[little-endian]] [[2's complement]]
}}
| {{ubli
| [[Single-precision floating-point format|Floats]]: [[little-endian]] [[binary32]]
| [[Double-precision floating-point format|Doubles]]: [[little-endian]] [[binary64]]
}}
| [[UTF-8]]-encoded, preceded by varint-encoded integer length of string in bytes
| Repeated value with the same tag or, for varint-encoded integers only, values packed contiguously and prefixed by tag and total byte length
| {{n/a}}
|- style="vertical-align:top;"
| [[Smile (data interchange format)|Smile]]
| <code>\x21</code>
| {{ubli
| True: <code>\x23</code>
| False: <code>\x22</code>
}}
| {{ubli
| Single byte "small" (values {{nowrap|−16 – 15}} encoded as {{nowrap|<code>\xc0</code>–<code>\xdf</code>}}),
| zigzag-encoded <code>varint</code>s (1–11 data bytes), or <code>BigInteger</code>
}}
| IEEE single/double, <code>BigDecimal</code>
| Length-prefixed "short" Strings (up to 64 bytes), marker-terminated "long" Strings and (optional) back-references
| Arbitrary-length heterogenous arrays with end-marker
| Arbitrary-length key/value pairs with end-marker
|- style="vertical-align:top;"
| [[SDXF|Structured Data eXchange Formats]] (SDXF)
|
|
| Big-endian signed 24-bit or 32-bit integer
| Big-endian IEEE double
| Either [[UTF-8]] or ISO 8859-1 encoded
| List of elements with identical ID and size, preceded by array header with int16 length
| Chunks can contain other chunks to arbitrary depth.
|- style="vertical-align:top;"
| [[Thrift (protocol)|Thrift]]
|
|
|
|
|
|
|
|}
{{sticky table end}}
{{notelist|group=binary}}
==See also==
*[[Comparison of document markup languages]]
==References==
{{reflist}}
==External links==
*[https://www.w3.org/TR/NOTE-xml-ql/ XML-QL Proposal discussing XML benefits]
*[https://www.xml.com/pub/a/2001/05/02/champion.html Daring to Do Less with XML]
[[Category:Data serialization formats]]
[[Category:Persistence]]
[[Category:Computing comparisons|Data-serialization formats]]
|