Decoding a protobuf response without a .proto file

Put the raw response into a file and send it through 'protoc' with the --decode_raw option to produce a human readable output.

cat sample.bin | protoc --decode_raw > structured.txt

sample.bin is a sample of a range of Protobuf data types as an example, that can be used in the above step. I've also create a JSON dump to help visualise the data.

{
  "scalars": {
    "double_value": 3.141592653589793,
    "float_value": 2.718,
    "int32_value": -42,
    "int64_value": "-9000000000",
    "uint32_value": 4000000000,
    "uint64_value": "18000000000000000000",
    "sint32_value": -123,
    "sint64_value": "-123456789012",
    "fixed32_value": 3735928559,
    "fixed64_value": "14627333968688430831",
    "sfixed32_value": -2000000000,
    "sfixed64_value": "-9000000000000000000",
    "bool_value": true,
    "string_value": "Hello, protobuf! \u2713",
    "bytes_value": "AAEC/2JpbmFyeQ=="
  },
  "status": "STATUS_ACTIVE",
  "featured_item": {
    "id": 1,
    "name": "Widget",
    "price": 9.99,
    "status": "STATUS_ACTIVE",
    "tags": [
      "new",
      "sale"
    ]
  },
  "numbers": [
    1,
    2,
    3,
    5,
    8,
    13
  ],
  "names": [
    "alice",
    "bob",
    "carol"
  ],
  "statuses": [
    "STATUS_ACTIVE",
    "STATUS_INACTIVE",
    "STATUS_DELETED"
  ],
  "items": [
    {
      "id": 10,
      "name": "Apple",
      "price": 0.5,
      "status": "STATUS_ACTIVE",
      "tags": [
        "fruit"
      ]
    },
    {
      "id": 11,
      "name": "Banana",
      "price": 0.25,
      "status": "STATUS_INACTIVE",
      "tags": [
        "fruit",
        "yellow"
      ]
    },
    {
      "id": 12,
      "name": "Carrot",
      "price": 0.1,
      "status": "STATUS_DELETED"
    }
  ],
  "counts": {
    "bananas": 7,
    "apples": 3
  },
  "labels": {
    "1000000000000": "trillion",
    "1": "one"
  },
  "items_by_key": {
    "sku-001": {
      "id": 100,
      "name": "Mapped item",
      "price": 19.95
    }
  },
  "item_payload": {
    "id": 200,
    "name": "Oneof item"
  },
  "nickname": "sample",
  "well_known": {
    "timestamp": "2026-12-01T22:03:52.054884Z",
    "duration": "90.250s",
    "struct_value": {
      "list": [
        1.0,
        "two",
        null
      ],
      "key": "value",
      "nested": {
        "flag": true
      },
      "number": 42.0
    },
    "value": "a dynamic value",
    "list_value": [
      1.0,
      "two",
      true,
      null
    ],
    "any": {
      "@type": "type.googleapis.com/sample.v1.Item",
      "id": 300,
      "name": "Packed in Any"
    },
    "empty": {},
    "string_wrapper": "wrapped string",
    "int32_wrapper": -1,
    "int64_wrapper": "-1000000000000",
    "uint32_wrapper": 1,
    "uint64_wrapper": "1000000000000",
    "float_wrapper": 1.5,
    "double_wrapper": 2.5,
    "bool_wrapper": false,
    "bytes_wrapper": "d3JhcHBlZCBieXRlcw=="
  },
  "metadata": {
    "request_id": "60164d3c-5f6e-42df-97c8-9e3142555e5a",
    "server_version": "1.0.0"
  }
}

And this is what protoc will output for the sample.bin file

1 {
  1: 0x400921fb54442d18
  2: 0x402df3b6
  3: 18446744073709551574
  4: 18446744064709551616
  5: 4000000000
  6: 18000000000000000000
  7: 245
  8: 246913578023
  9: 0xdeadbeef
  10: 0xcafebabedeadbeef
  11: 0x88ca6c00
  12: 0x831993af1d7c0000
  13: 1
  14: "Hello, protobuf! \342\234\223"
  15: "\000\001\002\377binary"
}
2: 1
3 {
  1: 1
  2: "Widget"
  3: 0x4023fae147ae147b
  4: 1
  5: "new"
  5: "sale"
}
4: "\001\002\003\005\010\r"
5: "alice"
5: "bob"
5: "carol"
6: "\001\002\003"
7 {
  1: 10
  2: "Apple"
  3: 0x3fe0000000000000
  4: 1
  5: "fruit"
}
7 {
  1: 11
  2: "Banana"
  3: 0x3fd0000000000000
  4: 2
  5: "fruit"
  5: "yellow"
}
7 {
  1: 12
  2: "Carrot"
  3: 0x3fb999999999999a
  4: 3
}
8 {
  1: "bananas"
  2: 7
}
8 {
  1: "apples"
  2: 3
}
9 {
  1: 1
  2: "one"
}
9 {
  1: 1000000000000
  2: "trillion"
}
10 {
  1: "sku-001"
  2 {
    1: 100
    2: "Mapped item"
    3: 0x4033f33333333333
  }
}
13 {
  1: 200
  2: "Oneof item"
}
14: "sample"
16 {
  1 {
    1: 1796162474
    2: 967752000
  }
  2 {
    1: 90
    2: 250000000
  }
  3 {
    1 {
      1: "key"
      2 {
        3: "value"
      }
    }
    1 {
      1: "list"
      2 {
        6 {
          1 {
            2: 0x3ff0000000000000
          }
          1 {
            3: "two"
          }
          1 {
            1: 0
          }
        }
      }
    }
    1 {
      1: "nested"
      2 {
        5 {
          1 {
            1: "flag"
            2 {
              4: 1
            }
          }
        }
      }
    }
    1 {
      1: "number"
      2 {
        2: 0x4045000000000000
      }
    }
  }
  4 {
    3: "a dynamic value"
  }
  5 {
    1 {
      2: 0x3ff0000000000000
    }
    1 {
      3: "two"
    }
    1 {
      4: 1
    }
    1 {
      1: 0
    }
  }
  6 {
    1: "type.googleapis.com/sample.v1.Item"
    2 {
      1: 300
      2: "Packed in Any"
    }
  }
  7: ""
  8 {
    1: "wrapped string"
  }
  9 {
    1: 18446744073709551615
  }
  10 {
    1: 18446743073709551616
  }
  11 {
    1: 1
  }
  12 {
    1: 1000000000000
  }
  13 {
    1: 0x3fc00000
  }
  14 {
    1: 0x4004000000000000
  }
  15: ""
  16 {
    1: "wrapped bytes"
  }
}
17 {
  1: "ff693be5-617f-45c5-9495-fcf9bdf2049d"
  2: "1.0.0"
}

Hex view of the sample data

Sample protobuf binary blob