Examples
Turn the official three-byte Protobuf message into a named field — step 1
Show how 08 is a field tag and 96 01 represents 150; the schema supplies the field name.
Input
3 bytes
DownloadExpected answer
JSON{
"a": 150
}{
"a": 150
}- Schema (.proto text)
syntax="proto3"; message Test1 { int32 a = 1; }- Show Unknown Fields
Off- Show Types
Off
Recover a length-delimited string from a Protobuf message
Explain the distinction between a byte count and the seven actual UTF-8 bytes of testing.
Input
9 bytes
DownloadExpected answer
JSON{
"b": "testing"
}{
"b": "testing"
}- Schema (.proto text)
syntax="proto3"; message Test2 { string b = 2; }- Show Unknown Fields
Off- Show Types
Off
Decode the same Protobuf bytes as either 3 or minus 2 — step 1
Demonstrate why a wire payload alone does not determine signedness or an application schema.
Input
2 bytes
DownloadExpected answer
JSON{
"a": 3
}{
"a": 3
}- Schema (.proto text)
syntax="proto3"; message Test { int32 a = 1; }- Show Unknown Fields
Off- Show Types
Off
Decode the same Protobuf bytes as either 3 or minus 2 — step 2
Demonstrate why a wire payload alone does not determine signedness or an application schema.
Input
2 bytes
DownloadExpected answer
JSON{
"a": -2
}{
"a": -2
}- Schema (.proto text)
syntax="proto3"; message Test { sint32 a = 1; }- Show Unknown Fields
Off- Show Types
Off
full schema, no unknown fields
Input
37 bytes
DownloadExpected answer
JSON{
"Apple": [
28
],
"Carrot": [
"Me"
],
"Banana": "You",
"Date": 43,
"Elderberry": {
"Fig": "abc123",
"Grape": {}
},
"Huckleberry": 255
}{
"Apple": [
28
],
"Carrot": [
"Me"
],
"Banana": "You",
"Date": 43,
"Elderberry": {
"Fig": "abc123",
"Grape": {}
},
"Huckleberry": 255
}- Schema (.proto text)
message Test { repeated fixed32 Apple = 1; optional string Banana = 2; repeated string Carrot = 3; optional int32 Date = 4; optional subTest Elderberry = 5; optional fixed64 Huckleberry = 6; } message subTest { optional string Fig = 1; optional subSubTest Grape = 2; } message subSubTest {}- Show Unknown Fields
Off- Show Types
Off
no schema
Input
28 bytes
DownloadExpected answer
JSON{
"1": 28,
"2": "You",
"3": "Me",
"4": 43,
"5": {
"1": "abc123",
"2": {}
}
}{
"1": 28,
"2": "You",
"3": "Me",
"4": 43,
"5": {
"1": "abc123",
"2": {}
}
}- Schema (.proto text)
(empty)- Show Unknown Fields
Off- Show Types
Off
partial schema, no unknown fields
Input
28 bytes
DownloadExpected answer
JSON{
"Apple": [
28
],
"Carrot": [
"Me"
],
"Banana": "You"
}{
"Apple": [
28
],
"Carrot": [
"Me"
],
"Banana": "You"
}- Schema (.proto text)
message Test { repeated fixed32 Apple = 1; optional string Banana = 2; repeated string Carrot = 3; }- Show Unknown Fields
Off- Show Types
Off
partial schema, show unknown fields
Input
28 bytes
DownloadExpected answer
JSON{
"Test": {
"Apple": [
28
],
"Carrot": [
"Me"
],
"Banana": "You"
},
"Unknown Fields": {
"4": 43,
"5": {
"1": "abc123",
"2": {}
}
}
}{
"Test": {
"Apple": [
28
],
"Carrot": [
"Me"
],
"Banana": "You"
},
"Unknown Fields": {
"4": 43,
"5": {
"1": "abc123",
"2": {}
}
}
}- Schema (.proto text)
message Test { repeated fixed32 Apple = 1; optional string Banana = 2; repeated string Carrot = 3; }- Show Unknown Fields
On- Show Types
Off
partial schema, show unknown fields, show types
Input
39 bytes
DownloadExpected answer
JSON{
"Test": {
"Carrot (string)": [
"Me"
],
"Banana (string)": "You",
"Date (int32)": 43,
"Imbe (Options)": "Option1"
},
"Unknown Fields": {
"field #1: 32-Bit (e.g. fixed32, float)": 28,
"field #5: L-delim (e.g. string, message)": {
"field #1: L-delim (e.g. string, message)": "abc123",
"field #2: L-delim (e.g. string, message)": {}
},
"field #6: 64-Bit (e.g. fixed64, double)": 3029774971578
}
}{
"Test": {
"Carrot (string)": [
"Me"
],
"Banana (string)": "You",
"Date (int32)": 43,
"Imbe (Options)": "Option1"
},
"Unknown Fields": {
"field #1: 32-Bit (e.g. fixed32, float)": 28,
"field #5: L-delim (e.g. string, message)": {
"field #1: L-delim (e.g. string, message)": "abc123",
"field #2: L-delim (e.g. string, message)": {}
},
"field #6: 64-Bit (e.g. fixed64, double)": 3029774971578
}
}- Schema (.proto text)
message Test { optional string Banana = 2; repeated string Carrot = 3; optional int32 Date = 4; optional Options Imbe = 7; } message subTest { optional string Fig = 1; optional subSubTest Grape = 2; } message subSubTest {} enum Options { Option0 = 0; Option1 = 1; Option2 = 2; }- Show Unknown Fields
On- Show Types
On
If a .proto schema is defined, the encoded data will be decoded with reference to the schema. Only one message instance will be decoded. Show Unknown Fields When a schema is used, this option shows fields that are present in the input data but not defined in the schema. Show Types Show the type of a field next to its name. For undefined fields, the wiretype and example types are shown instead.
Format reference: Protobuf Decode background and specification