Protobuf Encoder

Encode Protobuf data online. Read the input conventions, configure the available options and copy or download the result in your browser.

Free · No sign-up required

Text input

Your result is ready to copy or download after running.

Tool options
Enter the .proto schema that defines message types and field names.

About Protobuf Encoder

Encodes a valid JSON object into a protobuf byte array using the input .proto schema.

Input: structured JSON. Output: binary bytes (text input uses UTF-8; a file retains its original bytes).

Format reference: Protobuf Encode background and specification

Example

Use “Try example” to load this public sample and its settings, then run it.

Settings used in this example
ParameterExample valueInput and choices
Schema (.proto text)"message Test {\n repeated fixed32 Apple = 1;\n optional string Banana = 2;\n repeated string Carrot = 3;\n optional int32 Date = 4;\n optional subTest Elderberry = 5;\n repeated fixed64 Huckleberry = 6;\n optional Options Imbe = 7;\n }\n message subTest {\n optional string Fig = 1;\n optional subSubTest Grape = 2;\n }\n message subSubTest {}\n enum Options {\n Option0 = 0;\n Option1 = 1;\n Option2 = 2;\n }"Enter the .proto schema that defines message types and field names.

Input

{
    "Apple": [
        28
    ],
    "Banana": "You",
    "Carrot": [
        "Me"
    ],
    "Date": 43,
    "Elderberry": {
        "Fig": "abc123",
        "Grape": {}
    },
    "Huckleberry": [
        3029774971578
    ],
    "Imbe": 1
}

Result

hex

0d1c0000001203596f751a024d65202b2a0a0a06616263313233120031ba32a96cc10200003801

Parameters

ParameterDefault valueInput and choices
Schema (.proto text)""Enter the .proto schema that defines message types and field names.

Before interpreting the result

Protocol parsers need the correct byte representation and framing. HTTP Request and DNS over HTTPS contact remote services only when you run them; browser network and CORS restrictions still apply.

How to use this page

  1. Paste your input or open a local file.
  2. Adjust tool options if needed, then choose Run tool.
  3. Copy the result or download the original output bytes.

Inputs and results are not added to the public catalogue or saved in the URL. Processing happens in your browser; HTTP Request and DNS over HTTPS send the requests you explicitly run. Files up to 128 MiB can be opened; decompression and image tools may have smaller processing limits. Large results have a shortened preview. Text and HTML downloads use UTF-8; binary downloads preserve output bytes. Pasted text follows browser newline handling; open a file when exact input bytes matter.

Related tools

Browse networking tools