Reading .proto Files: Field Numbers, JSON Names and gRPC Services
Understand protobuf messages, field numbers, wire types, reserved fields and the proto3 JSON mapping, and browse any .proto file with sample JSON.

Protocol Buffers describe data in .proto files that are compact for machines and not always friendly for people. When you are debugging a gRPC call, writing a test fixture or reviewing a schema change, you need to know field numbers, JSON names and what a valid message looks like. The Protobuf Schema Viewer parses a .proto file in the browser and answers those questions.
Messages, fields and numbers
A message is a set of typed fields, and every field has a number. The number, not the name, is what goes over the wire. That is why numbers matter so much: changing a field's number or reusing an old number for a different field silently corrupts data between services running different schema versions.
Numbers run from 1 to 536,870,911, and 19000 to 19999 are reserved by the implementation. Numbers 1 to 15 take one byte to encode together with the field's type, so they are best kept for frequently used fields.
When you delete a field, reserve its number and name so nobody reuses them. The viewer shows reserved ranges for each message and raises an error if a field uses one.
Labels, oneofs and maps
A field can be singular, optional or repeated. In proto2 every field needs a label and required exists; proto3 removed required because it made schema evolution dangerous. A oneof groups fields of which at most one is set, often used for alternatives such as a card or a voucher. A map is a repeated key-value pair with a compact syntax.
The message table shows each field's number, label, type, oneof group and JSON name, sorted by number so gaps and clashes are easy to spot.
Wire types
Each field is encoded with a wire type: varint for most integers, booleans and enums; 64-bit for fixed64, sfixed64 and double; 32-bit for fixed32, sfixed32 and float; and length-delimited for strings, bytes, nested messages, maps and packed repeated fields. Knowing the wire type helps when reading raw bytes in a debugger or a wire-format decoder.
The JSON mapping
Many systems exchange protobuf messages as JSON, for example through gRPC-Gateway or in logs. The canonical mapping, ProtoJSON, has rules that catch people out:
- Field names become lowerCamelCase, so order_id becomes orderId, unless json_name overrides it.
- 64-bit integers are strings, because JavaScript numbers cannot hold every 64-bit value.
- Bytes are base64, enums are their names and maps are JSON objects.
- Well-known types have special forms: a Timestamp is an RFC 3339 string and a Duration is a number of seconds with an s suffix.
The viewer generates a sample for every message following these rules, filling only the first member of each oneof and stopping recursive messages after a few levels. Copy one sample or download all of them as a test fixture file.
Services and RPCs
The services tab lists each RPC with its request and response types and its streaming mode: unary, client streaming, server streaming or bidirectional. It also shows the HTTP/2 path a gRPC client calls, built from the package, service and method names. That path is what you see in proxy logs and what you configure in gateways.
Checks before code generation
The checks tab catches errors that protoc would reject, such as duplicate numbers, reserved numbers in use, required in proto3 and enums whose first value is not zero. Style notices follow the official guide: lower_snake_case field names, an UNSPECIFIED zero value for enums and small numbers for frequent fields.
Limits
The viewer reads one file at a time, so types from imported files show as unresolved unless they are well-known types. Custom options, extensions and proto2 groups are not modelled. Use protoc or buf for authoritative compilation and code generation, and a raw wire-format decoder for binary payloads.



