Skip to main content

Protobuf Text ↔ JSON Converter

Convert Protocol Buffers text format (prototext) to JSON and back. Schema-less structural conversion: nested messages become objects and repeated fields become arrays. Pick a direction and indentation.

Input

Output

Result
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/protobuf-text-json-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputText": "# Person message example\nname: \"John Doe\"\nid: 12…",
    "convertMode": "proto-to-json",
    "indentation": "2"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `protobuf-text-json-converter` tool (Protobuf Text ↔ JSON Converter) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/protobuf-text-json-converter/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Protobuf Text ↔ JSON Converter — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

Convert Protocol Buffers text format (also called prototext or textproto) to JSON and back, right in your browser. Paste a message, pick a direction, and get a clean, indented result — no .proto schema, no compiler, no upload.

This is a schema-less, structural converter. It maps the shape of the data, not its wire encoding: it does not decode or produce binary protobuf. If you have the human-readable text form (name: "Alice", nested { } blocks, repeated keys), this tool is for you.

How to use it

  1. Paste your Protobuf text format or JSON into the Input box.
  2. Choose a Direction:
    • Protobuf Text → JSON turns prototext into a JSON object.
    • JSON → Protobuf Text turns a JSON object back into prototext.
  3. Pick 2 or 4 space indentation for the output.
  4. The Result updates automatically. Copy or download it.

What gets converted

  • Scalars — quoted strings, integers, floats, and true/false booleans.
  • Nested messages — a field { ... } block (or the older field < ... > form) becomes a nested JSON object.
  • Repeated fields — a key that appears more than once collapses into a JSON array, and JSON arrays expand back into repeated keys.
  • Enum values — bare UPPER_CASE identifiers stay unquoted when writing prototext and become plain strings in JSON.
  • Comments# line comments in prototext are ignored while parsing.

Example

Prototext input:

name: "John Doe"
id: 1234
address {
  city: "Springfield"
}
tags: "developer"
tags: "golang"

Becomes JSON:

{
  "name": "John Doe",
  "id": 1234,
  "address": { "city": "Springfield" },
  "tags": ["developer", "golang"]
}

Why isn't this the same as binary protobuf?

Binary protobuf encoding requires a .proto schema so it knows each field's number and type. Text format is self-describing enough to read structurally, which is why this converter can work without a schema. Use it for debugging log dumps, fixtures, and config in text format — not for parsing .pb binary payloads.

Does my data leave the browser?

No. The conversion runs entirely client-side in your browser. Nothing you paste is sent to a server.

protobufprototextjsonconvertertextproto

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.