Protobuf Formatter
Format and pretty-print .proto (Protocol Buffers) source — consistent indentation, blank-line spacing between messages/enums/services, aligned enum values, and optional sorting of fields by tag number. Includes basic syntax validation. Runs entirely in your browser.
Input
Output
| Issue |
|---|
| No data yet |
Guides
Paste inconsistently indented .proto source and get back a cleanly formatted Protocol Buffers schema — consistent indentation, blank lines between messages/enums/services, aligned enum values, and an optional sort of fields by tag number. A quick validation pass flags unbalanced braces, an unterminated string or comment, and a missing syntax declaration. Everything runs locally in your browser.
How to use it
- Paste your
.protofile content. - Choose 2 spaces or 4 spaces for indentation.
- Turn on Sort fields by tag number to reorder each message's fields by their tag number (comments stay attached to the field they preceded) — leave it off to keep your original field order.
- Check the Validation panel for any syntax issues, and copy or download the formatted result.
What it formats
syntax,package,importand top-leveloptionstatements, grouped and ordered at the top of the file.messagebodies, including nested messages,oneofblocks,map<K, V>fields,reservedandextensionsstatements.enumbodies, with every value's=aligned to the longest name in that enum.servicebodies, with eachrpcmethod (includingstreamrequest/response and inline rpc options) on its own block, separated by a blank line.- Line (
//) and block (/* */) comments — both standalone and attached to the statement they lead or trail.
Does it validate the schema semantically?
No — this checks syntax, not schema semantics. It won't catch a duplicate field tag number, an undefined message type reference, or an incompatible field type change; it flags structural problems (unbalanced braces, an unterminated string/comment) and a missing syntax = "proto2"|"proto3" declaration. For real compilation, use protoc or your language's protobuf compiler.
Is my schema uploaded anywhere?
No. Tokenizing, parsing and formatting all run locally in your browser; your .proto source is never sent to a server.
Need to work with protobuf data instead of the schema file?
Use the Protobuf Text ↔ JSON Converter to convert prototext to JSON and back. For other schema/config formats, see the GraphQL Schema Formatter or the SQL Formatter.
Use it from code
From 3 credits per callREST API
curl -X POST https://api.iotools.cloud/v1/tool/protobuf-formatter \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"protobufInput": "syntax = \"proto3\";\n\nmessage User {\n string id…",
"indentSize": "2",
"sortFields": ""
}'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-formatter` tool (Protobuf Formatter) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.