This is a comparison of data serialization formats, various ways to convert complex objects to sequences of bits. It does not include markup languages used exclusively as document file formats.
<foo />
<foo>true</foo>
<foo>false</foo>
<foo>685230</foo>
<foo>6.8523015e+5</foo>
<foo>A to Z</foo>
<SeqOfUnrelatedDatatypes> <isMarried>true</isMarried> <hobby /> <velocity>-42.1e7</velocity> <bookname>A to Z</bookname> <bookname>We said, "no".</bookname> </SeqOfUnrelatedDatatypes>
<person> <isMarried>true</isMarried> <hobby /> <height>1.85</height> <name>Bob Peterson</name> </person>
A data mapping (the key is a data value):
<competition> <measurement> <name>John</name> <height>3.14</height> </measurement> <measurement> <name>Jane</name> <height>2.718</height> </measurement> </competition>
a
null
1
true
0
false
685230
-685230
6.8523015e+5
A to Z
"We said, ""no""."
true,,-42.1e7,"A to Z"
42,1 A to Z,1,2,3
nil
"A to Z"
"A \"up to\" Z"
[true nil -42.1e7 "A to Z"]
{:kw 1, "42" true, "A to Z" [1 2 3]}
null null.null null.bool null.int null.float null.decimal null.timestamp null.string null.symbol null.blob null.clob null.struct null.list null.sexp
null.null
null.bool
null.int
null.float
null.decimal
null.timestamp
null.string
null.symbol
null.blob
null.clob
null.struct
null.list
null.sexp
0xA74AE
0b111010010101110
6.8523015e5
'''A to Z'''
[true, null, -42.1e7, "A to Z"]
{'42': true, 'A to Z': [1, 2, 3]}
0:,
4:null,
1:1,
4:true,
1:0,
5:false,
6:685230,
9:6.8523e+5,
6:A to Z,
29:4:true,0:,7:-42.1e7,6:A to Z,,
41:9:2:42,1:1,,25:6:A to Z,12:1:1,1:2,1:3,,,,
{"42": true, "A to Z": [1, 2, 3]}
'A to Z'
NoSpaces
true null -42.1e7 "A to Z"
(true, null, -42.1e7, "A to Z")
42 true "A to Z" 1 2 3
42 true "A to Z", (1, 2, 3)
ref {null}
bool {true}
bool {false}
int32 {685230}
int32 {0x74AE}
int32 {0b111010010101110}
float {6.8523015e+5}
string {"A to Z"}
int32 {1, 2, 3, 4, 5}
Heterogeneous array:
array { bool {true} ref {null} float {-42.1e7} string {"A to Z"} }
dict { value (key = "42") {bool {true}} value (key = "A to Z") {int32 {1, 2, 3}} }
N;
b:1;
b:0;
i:685230;
i:-685230;
d:685230.15;
d:INF;
d:-INF;
d:NAN;
s:6:"A to Z";
a:4:{i:0;b:1;i:1;N;i:2;d:-421000000;i:3;s:6:"A to Z";}
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;}}
O:8:"stdClass":2:{s:4:"John";d:3.14;s:4:"Jane";d:2.718;}
N.
I01\n.
I00\n.
I685230\n.
F685230.15\n.
S'A to Z'\n.
(lI01\na(laF-421000000.0\naS'A to Z'\na.
(dI42\nI01\nsS'A to Z'\n(lI1\naI2\naI3\nas.
<*BY>
<*BN>
<*I685230>
<*R6.8523015e+5>
( <*BY>, <*R-42.1e7>, "A to Z" )
{ "42" = <*BY>; "A to Z" = ( <*I1>, <*I2>, <*I3> ); }
<true />
<false />
<integer>685230</integer>
<real>6.8523015e+5</real>
<string>A to Z</string>
<array> <true /> <real>-42.1e7</real> <string>A to Z</string> </array>
<dict> <key>42</key> <true /> <key>A to Z</key> <array> <integer>1</integer> <integer>2</integer> <integer>3</integer> </array> </dict>
20.0855369
"A to Z""sdfff2 \000\001\002\377\376\375""q\tqq<>q2&\001\377"
field1: "value1" field1: "value2" field1: "value3
anotherfield { foo: 123 bar: 456 } anotherfield { foo: 222 bar: 333 }
thing1: "blahblah" thing2: 18923743 thing3: -44 thing4 { submessage_field1: "foo" submessage_field2: false } enumeratedThing: SomeEnumeratedValue thing5: 123.456 [extensionFieldFoo]: "etc" [extensionFieldThatIsAnEnum]: EnumValue
NIL
T
#t
#f
abc
"abc"
#616263#
3:abc
{MzphYmM=}
|YWJj|
(T NIL -42.1e7 "A to Z")
((42 T) ("A to Z" (1 2 3)))
~
Null
NULL
y
Y
yes
Yes
YES
on
On
ON
True
TRUE
n
N
no
No
NO
off
Off
OFF
False
FALSE
+685_230
02472256
0x_0A_74_AE
0b1010_0111_0100_1010_1110
190:20:30
685.230_15e+03
685_230.15
190:20:30.15
.inf
-.inf
.Inf
.INF
.NaN
.nan
.NAN
[y, ~, -42.1e7, "A to Z"]
- y - - -42.1e7 - A to Z
{"John":3.14, "Jane":2.718}
42: y A to Z: [1, 2, 3]
<null />
<item>true</item> <item xsi:nil="true"/> <item>-42.1e7</item> <item>A to Z<item>
<map> <entry key="42">true</entry> <entry key="A to Z"> <item val="1"/> <item val="2"/> <item val="3"/> </entry> </map>
<value><boolean>1</boolean></value>
<value><boolean>0</boolean></value>
<value><int>685230</int></value>
<value><double>6.8523015e+5</double></value>
<value><string>A to Z</string></value>
<value><array> <data> <value><boolean>1</boolean></value> <value><double>-42.1e7</double></value> <value><string>A to Z</string></value> </data> </array></value>
<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>
\x0A
\x08\x01
\x08\x00
\xf6
\xf5
\xf4
(1 byte)
\x00
\x17
\x20
\x37
\x18
\x38
\x19
\x39
\x1A
\x3A
\x1B
\x3B
\xf9
\xfb
\xc4
\x40
\x5f
\x60
\x7f
\xff
\x80
\x9e
\x9f
\xa0
\xbe
\xbf
(Unpreserved lexical values format)
Unsigned skips the boolean flag.
\x01
\x0f
\x11
\x10
\x2x
\x3x
\x44
\x48
\x8x
\x9x
\xbx
\xdx
\xex
\xc0
\xc3
\xc2
encoding is unspecified[19]
Length counts only octets between ':' and ','
(n << 1) XOR (n >> 31)
(n << 1) XOR (n >> 63)
\x21
\x23
\x22
\xdf
varint
BigInteger
BigDecimal