Protobuf Definition Parser
Parse .proto definition text to visualize messages, enums, services, and convert to JSON Schema or TypeScript.
About This Tool
The Protobuf Definition Parser is a free browser-based tool that
parses Protocol Buffer (.proto) definition files and displays
their structure in an interactive tree view. Protocol Buffers
(protobuf) is Google's language-neutral, platform-neutral
serialization format used extensively in gRPC services,
microservice communication, and data storage. Instead of manually
reading through complex .proto files, this tool gives you a
structured visualization of every message, field, enum, service,
and RPC definition in seconds.
The parser handles proto3 and proto2 syntax and extracts all
structural elements: messages with their fields (including type,
field number, and labels like repeated, optional, and
required), nested messages, enums with their values,
oneof groups, map fields, and service definitions with
their RPC methods (including client and server streaming). Field
types are highlighted to distinguish between scalar types
(like int32, string, bool) and message or enum
references. Syntax errors are reported with line numbers so you
can quickly fix issues in your definitions.
Beyond visualization, the tool can convert your protobuf definitions into two useful output formats. The JSON Schema output generates a standards-compliant JSON Schema that describes the structure of your protobuf messages — useful for validating JSON representations of protobuf data with our JSON Schema Generator. The TypeScript output generates type-safe TypeScript interfaces and enums that mirror your protobuf structure, similar to what our JSON to TypeScript converter produces from JSON data. Both outputs can be combined with the JSON YAML Converter for further format transformations.
All parsing and code generation runs entirely in your browser
using JavaScript. Your .proto definitions never leave your
machine — there are no server round-trips, no logging, and no
third-party services involved. This makes it safe to use with
proprietary API definitions and internal service schemas.
How to Use
- Paste your
.protodefinition text into the Input panel on the left. - The parsed structure updates automatically in the right panel as you type.
- Click Tree View to see an interactive, collapsible tree of messages, enums, and services.
- Click JSON Schema to generate a JSON Schema representation of your protobuf messages.
- Click TypeScript to generate TypeScript interfaces and enums from your definitions.
- Use the Basic Messages or E-Commerce preset buttons to load sample
.protodefinitions. - Click Copy or press Ctrl+Shift+C to copy the generated output to your clipboard.
Popular Protobuf Definition Examples
FAQ
Which protobuf syntax versions are supported?
The parser supports both proto3 and proto2 syntax. It recognizes the syntax declaration, messages, enums, services, oneof groups, map fields, repeated/optional/required labels, and nested definitions. Proto3 is the recommended and most commonly used version.
How does the JSON Schema conversion work?
Each protobuf message is converted to a JSON Schema object type. Scalar types are mapped to their JSON equivalents (int32/int64 to integer, double/float to number, string to string, bool to boolean, bytes to string with base64 encoding). Repeated fields become arrays, map fields become objects with additionalProperties, and enum fields become string enums. Nested messages are resolved inline.
How does the TypeScript conversion work?
Each protobuf message is converted to a TypeScript interface with properly typed fields. Scalar types map to TypeScript primitives (number, string, boolean, Uint8Array for bytes). Repeated fields become arrays, map fields become Record types, and enums become TypeScript enums with numeric values. Oneof groups are represented as optional union types. Services become interfaces with method signatures.
Does it handle nested messages and enums?
Yes. The parser fully supports nested message and enum definitions at any depth. In the tree view, nested types appear as collapsible child nodes under their parent message. In JSON Schema output, nested types are resolved inline. In TypeScript output, nested enums and interfaces are generated alongside the parent interface.
How are gRPC services and streaming RPCs displayed?
Services are shown in the tree view with their RPC methods, including input and output types. Client streaming (stream keyword on input) and server streaming (stream keyword on output) are clearly indicated. In TypeScript output, streaming RPCs use AsyncIterable types for stream parameters and return types.
Is my data safe?
Yes. All parsing and code generation runs entirely in your browser using JavaScript. No data is sent to any server. You can verify this by checking the Network tab in your browser's developer tools while using the tool.
What happens if my .proto file has syntax errors?
The parser reports syntax errors with line numbers in a warning banner above the output panel. It attempts to parse as much of the definition as possible, so you may still see partial results even when errors are present. Common issues include missing semicolons, unclosed braces, and missing field numbers.
Related Tools
JSON Schema Generator
Generate JSON Schema from sample JSON data with type inference, required fields, and nested object support.
JSON to TypeScript
Generate TypeScript interfaces or type aliases from JSON with nested type inference.
JSON ↔ YAML Converter
Convert between JSON and YAML formats instantly with syntax validation.
JSON Formatter
Format, validate, and beautify JSON with syntax highlighting and tree view.
JSON to Go Struct
Convert JSON to Go struct definitions instantly. Generates idiomatic Go types with json tags and proper naming.