protoc --descriptor_set_out=out.desc writes a
FileDescriptorSet, a message of the schema
descriptor.proto
that describes one or more .proto files. Its files are usually named
.desc, .binpb or .pb. The explorer reads every
field below when the bytes fit the schema and every file’s name ends in
.proto; custom options in the options messages’ extension ranges are
allowed and shown as raw fields. Field numbers are those of the main branch of
Protocol Buffers in November 2026.
FileDescriptorSet
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | file | repeated FileDescriptorProto | The files. |
The message and SourceCodeInfo each reserve extension number 536,000,000.
FileDescriptorProto
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The file’s name, relative to a source root. |
| 2 | package | string | The package. |
| 3 | dependency | repeated string | Imported files. |
| 10 | public_dependency | repeated int32 | Indexes of imports that are public. |
| 11 | weak_dependency | repeated int32 | Indexes of imports that are weak. |
| 15 | option_dependency | repeated string | Imports used only for options. |
| 4 | message_type | repeated DescriptorProto | Top-level messages. |
| 5 | enum_type | repeated EnumDescriptorProto | Top-level enums. |
| 6 | service | repeated ServiceDescriptorProto | Services. |
| 7 | extension | repeated FieldDescriptorProto | Top-level extensions. |
| 8 | options | FileOptions | File options. |
| 9 | source_code_info | SourceCodeInfo | Locations and comments, when kept. |
| 12 | syntax | string | proto2, proto3, or editions for edition files. Missing means proto2. |
| 14 | edition | Edition | The edition, for edition files. |
Edition values
| Value | Name |
|---|---|
| 0 | EDITION_UNKNOWN |
| 1 | EDITION_1_TEST_ONLY |
| 2 | EDITION_2_TEST_ONLY |
| 900 | EDITION_LEGACY |
| 998 | EDITION_PROTO2 |
| 999 | EDITION_PROTO3 |
| 1000 | EDITION_2023 |
| 1001 | EDITION_2024 |
| 1002 | EDITION_2026 |
| 9999 | EDITION_UNSTABLE |
| 99997 | EDITION_99997_TEST_ONLY |
| 99998 | EDITION_99998_TEST_ONLY |
| 99999 | EDITION_99999_TEST_ONLY |
| 2147483647 | EDITION_MAX |
DescriptorProto
A message type.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 2 | field | repeated FieldDescriptorProto | Fields. |
| 6 | extension | repeated FieldDescriptorProto | Extensions declared inside it. |
| 3 | nested_type | repeated DescriptorProto | Nested messages. |
| 4 | enum_type | repeated EnumDescriptorProto | Nested enums. |
| 5 | extension_range | repeated ExtensionRange | Numbers open to extensions. |
| 8 | oneof_decl | repeated OneofDescriptorProto | Oneofs. |
| 7 | options | MessageOptions | Options. |
| 9 | reserved_range | repeated ReservedRange | Reserved numbers. |
| 10 | reserved_name | repeated string | Reserved names. |
| 11 | visibility | SymbolVisibility | VISIBILITY_UNSET 0, VISIBILITY_LOCAL 1, VISIBILITY_EXPORT 2. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | start | int32 | First number, inclusive. |
| 2 | end | int32 | Last number, exclusive. |
| 3 | options | ExtensionRangeOptions | Options. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | start | int32 | First number, inclusive. |
| 2 | end | int32 | Last number, exclusive. |
ExtensionRangeOptions
| Field | Name | Type | Meaning |
|---|---|---|---|
| 2 | declaration | repeated Declaration | Which extension uses which number. |
| 50 | features | FeatureSet | Edition features. |
| 3 | verification | VerificationState | DECLARATION 0 or UNVERIFIED 1. |
| 999 | uninterpreted_option | repeated UninterpretedOption | Options not yet interpreted. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | number | int32 | The extension’s number. |
| 2 | full_name | string | Its fully qualified name. |
| 3 | type | string | Its type. |
| 5 | reserved | bool | Whether the number is reserved. |
| 6 | repeated | bool | Whether it is repeated. Number 4 is reserved. |
FieldDescriptorProto
A field, or an extension when extendee is set.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 3 | number | int32 | The field number. |
| 4 | label | Label | LABEL_OPTIONAL 1, LABEL_REQUIRED 2, LABEL_REPEATED 3. |
| 5 | type | Type | The field’s type. |
| 6 | type_name | string | The name of a message or enum type. |
| 2 | extendee | string | For an extension: the message it extends. |
| 7 | default_value | string | An explicit [default = …], as text. |
| 9 | oneof_index | int32 | Index of the oneof it belongs to. |
| 10 | json_name | string | Its name in ProtoJSON. |
| 8 | options | FieldOptions | Options. |
| 17 | proto3_optional | bool | A proto3 optional field. |
| Value | Name | Value | Name |
|---|---|---|---|
| 1 | TYPE_DOUBLE | 10 | TYPE_GROUP |
| 2 | TYPE_FLOAT | 11 | TYPE_MESSAGE |
| 3 | TYPE_INT64 | 12 | TYPE_BYTES |
| 4 | TYPE_UINT64 | 13 | TYPE_UINT32 |
| 5 | TYPE_INT32 | 14 | TYPE_ENUM |
| 6 | TYPE_FIXED64 | 15 | TYPE_SFIXED32 |
| 7 | TYPE_FIXED32 | 16 | TYPE_SFIXED64 |
| 8 | TYPE_BOOL | 17 | TYPE_SINT32 |
| 9 | TYPE_STRING | 18 | TYPE_SINT64 |
OneofDescriptorProto
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 2 | options | OneofOptions | Options. |
EnumDescriptorProto and EnumValueDescriptorProto
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 2 | value | repeated EnumValueDescriptorProto | The values. |
| 3 | options | EnumOptions | Options. |
| 4 | reserved_range | repeated EnumReservedRange | Reserved numbers. |
| 5 | reserved_name | repeated string | Reserved names. |
| 6 | visibility | SymbolVisibility | VISIBILITY_UNSET 0, VISIBILITY_LOCAL 1, VISIBILITY_EXPORT 2. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | start | int32 | First number. |
| 2 | end | int32 | Last number. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 2 | number | int32 | The number. |
| 3 | options | EnumValueOptions | Options. |
ServiceDescriptorProto and MethodDescriptorProto
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 2 | method | repeated MethodDescriptorProto | The methods. |
| 3 | options | ServiceOptions | Options. Number 4 and the name stream are reserved. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The name. |
| 2 | input_type | string | The request message. |
| 3 | output_type | string | The response message. |
| 4 | options | MethodOptions | Options. |
| 5 | client_streaming | bool | Whether the client streams. |
| 6 | server_streaming | bool | Whether the server streams. |
FileOptions
Extension ranges: 990 to 998 and 1000 to the maximum. Numbers 38 and 42 are reserved.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | java_package | string | The Java package. |
| 8 | java_outer_classname | string | The Java outer class. |
| 10 | java_multiple_files | bool | One Java file per class. |
| 20 | java_generate_equals_and_hash | bool | Deprecated. |
| 27 | java_string_check_utf8 | bool | Check UTF-8 in Java. |
| 9 | optimize_for | OptimizeMode | SPEED 1, CODE_SIZE 2, LITE_RUNTIME 3. |
| 11 | go_package | string | The Go package. |
| 16 | cc_generic_services | bool | Generate C++ service stubs. |
| 17 | java_generic_services | bool | Generate Java service stubs. |
| 18 | py_generic_services | bool | Generate Python service stubs. |
| 23 | deprecated | bool | Deprecated. |
| 31 | cc_enable_arenas | bool | C++ arena allocation. |
| 36 | objc_class_prefix | string | Objective-C class prefix. |
| 37 | csharp_namespace | string | C# namespace. |
| 39 | swift_prefix | string | Swift prefix. |
| 40 | php_class_prefix | string | PHP class prefix. |
| 41 | php_namespace | string | PHP namespace. |
| 44 | php_metadata_namespace | string | PHP metadata namespace. |
| 45 | ruby_package | string | Ruby package. |
| 50 | features | FeatureSet | Edition features. |
| 999 | uninterpreted_option | repeated UninterpretedOption | Options not yet interpreted. |
MessageOptions
Extension ranges: 990 to 998 and 1000 to the maximum. Numbers 4, 5, 6, 8 and 9 are reserved.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | message_set_wire_format | bool | Use the MessageSet wire format. |
| 2 | no_standard_descriptor_accessor | bool | No descriptor() accessor. |
| 3 | deprecated | bool | Deprecated. |
| 7 | map_entry | bool | The synthetic entry of a map field. |
| 11 | deprecated_legacy_json_field_conflicts | bool | Allows JSON name conflicts, for old files. |
| 12 | features | FeatureSet | Edition features. |
| 999 | uninterpreted_option | repeated UninterpretedOption | Options not yet interpreted. |
FieldOptions
Extension ranges: 990 to 998 and 1000 to the maximum. Numbers 4 and 18 are reserved.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | ctype | CType | STRING 0, CORD 1, STRING_PIECE 2. |
| 2 | packed | bool | Packed encoding. |
| 6 | jstype | JSType | JS_NORMAL 0, JS_STRING 1, JS_NUMBER 2. |
| 5 | lazy | bool | Parse the message lazily. |
| 15 | unverified_lazy | bool | Lazily, without verification. |
| 3 | deprecated | bool | Deprecated. |
| 10 | weak | bool | Deprecated: a weak reference. |
| 16 | debug_redact | bool | Redact in debug output. |
| 17 | retention | OptionRetention | RETENTION_UNKNOWN 0, RETENTION_RUNTIME 1, RETENTION_SOURCE 2. |
| 19 | targets | repeated OptionTargetType | What an option applies to: TARGET_TYPE_UNKNOWN 0, …_FILE 1, …_EXTENSION_RANGE 2, …_MESSAGE 3, …_FIELD 4, …_ONEOF 5, …_ENUM 6, …_ENUM_ENTRY 7, …_SERVICE 8, …_METHOD 9. |
| 20 | edition_defaults | repeated EditionDefault | Defaults per edition. |
| 21 | features | FeatureSet | Edition features. |
| 22 | feature_support | FeatureSupport | The editions a feature is available in. |
| 999 | uninterpreted_option | repeated UninterpretedOption | Options not yet interpreted. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 3 | edition | Edition | The edition. |
| 2 | value | string | The default, as text. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | edition_introduced | Edition | First edition. |
| 2 | edition_deprecated | Edition | Deprecated from. |
| 3 | deprecation_warning | string | The warning. |
| 4 | edition_removed | Edition | Removed from. |
| 5 | removal_error | string | The error. |
OneofOptions, EnumOptions, EnumValueOptions, ServiceOptions, MethodOptions
All five end in extension ranges 990 to 998 and 1000 to the maximum, and have an
uninterpreted_option field 999.
| Message | Field | Name | Meaning |
|---|---|---|---|
| OneofOptions | 1 | features | FeatureSet. |
| EnumOptions | 2 | allow_alias | Allows two names for one number. |
| 3 | deprecated | Deprecated. | |
| 6 | deprecated_legacy_json_field_conflicts | Allows JSON name conflicts, for old files. | |
| 7 | features | FeatureSet. Number 5 is reserved. | |
| EnumValueOptions | 1 | deprecated | Deprecated. |
| 2 | features | FeatureSet. | |
| 3 | debug_redact | Redact in debug output. | |
| 4 | feature_support | FeatureSupport. | |
| ServiceOptions | 34 | features | FeatureSet. |
| 33 | deprecated | Deprecated. | |
| MethodOptions | 33 | deprecated | Deprecated. |
| 34 | idempotency_level | IDEMPOTENCY_UNKNOWN 0, NO_SIDE_EFFECTS 1, IDEMPOTENT 2. | |
| 35 | features | FeatureSet. |
UninterpretedOption
An option as written, before protoc has worked out what it is.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 2 | name | repeated NamePart | The option’s name, in parts. |
| 3 | identifier_value | string | An identifier. |
| 4 | positive_int_value | uint64 | A positive integer. |
| 5 | negative_int_value | int64 | A negative integer. |
| 6 | double_value | double | A number. |
| 7 | string_value | bytes | A string. |
| 8 | aggregate_value | string | A message, as text. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name_part | string (required) | The part. |
| 2 | is_extension | bool (required) | Whether it is an extension name in parentheses. |
FeatureSet
Edition features at one level. See Editions and features.
| Field | Name | Values |
|---|---|---|
| 1 | field_presence | EXPLICIT 1, IMPLICIT 2, LEGACY_REQUIRED 3. |
| 2 | enum_type | OPEN 1, CLOSED 2. |
| 3 | repeated_field_encoding | PACKED 1, EXPANDED 2. |
| 4 | utf8_validation | VERIFY 2, NONE 3 (1 reserved). |
| 5 | message_encoding | LENGTH_PREFIXED 1, DELIMITED 2. |
| 6 | json_format | ALLOW 1, LEGACY_BEST_EFFORT 2. |
| 7 | enforce_naming_style | STYLE2024 1, STYLE_LEGACY 2, STYLE2026 3. |
| 8 | default_symbol_visibility | EXPORT_ALL 1, EXPORT_TOP_LEVEL 2, LOCAL_ALL 3, STRICT 4. |
| 9 | enforce_proto_limits | LEGACY_NO_EXPLICIT_LIMITS 1, PROTO_LIMITS2026 2. |
Each enum’s value 0 is its unknown value, as in FIELD_PRESENCE_UNKNOWN.
Number 999 is reserved. Numbers 1000 to 9994 are for language features, 9995 to
9999 for internal testing and 10000 for protobuf-es.
Extensions declared in descriptor.proto
descriptor.proto declares these extensions of its own messages, so that
their numbers are taken. The explorer reads the three whose schemas are published
with Protocol Buffers (C++, Java and Go features) field by field, and names the
others.
| Extends | Number | Name | Type |
|---|---|---|---|
| FeatureSet | 1000 | pb.cpp | CppFeatures |
| FeatureSet | 1001 | pb.java | JavaFeatures |
| FeatureSet | 1002 | pb.go | GoFeatures |
| FeatureSet | 1003 | pb.python | PythonFeatures (no schema published) |
| FeatureSet | 1004 | pb.csharp | CSharpFeatures |
| FeatureSet | 1100 | imp.impress_feature_set | ImpressFeatureSet |
| FeatureSet | 9989 | pb.java_mutable | JavaMutableFeatures |
| FeatureSet | 9990 | pb.proto1 | Proto1Features |
| FileOptions | 990 | pb.file.cpp | CppFileOptions |
| EnumValueOptions | 998 | pb.enumvalue.json | JsonEnumValueOptions (no schema published) |
| FileDescriptorSet | 536000000 | buf.descriptor.v1.buf_file_descriptor_set_extension | Buf’s FileDescriptorSetExtension |
| SourceCodeInfo | 536000000 | buf.descriptor.v1.buf_source_code_info_extension | Buf’s SourceCodeInfoExtension |
| Field | Name | Values |
|---|---|---|
| 1 | legacy_closed_enum | bool: treat enums as closed whatever enum_type says; deprecated in Edition 2023. |
| 2 | string_type | VIEW 1, CORD 2, STRING 3. |
| 3 | enum_name_uses_string_view | bool. |
| 4 | repeated_type | LEGACY 1, PROXY 2. |
| Field | Name | Values |
|---|---|---|
| 1 | legacy_closed_enum | bool. |
| 2 | utf8_validation | DEFAULT 1, VERIFY 2. |
| 3 | large_enum | bool. |
| 4 | use_old_outer_classname_default | bool. |
| 5 | nest_in_file_class | NO 1, YES 2, LEGACY 3. |
| Field | Name | Values |
|---|---|---|
| 1 | legacy_unmarshal_json_enum | bool: generate the deprecated UnmarshalJSON method for enums. |
| 2 | api_level | API_OPEN, API_HYBRID, API_OPAQUE. |
| 3 | strip_enum_prefix | STRIP_ENUM_PREFIX_KEEP 1, …_GENERATE_BOTH 2, …_STRIP 3. |
| 4 | optimize_mode | enum OptimizeModeFeature.OptimizeMode: OPTIMIZE_MODE_UNSPECIFIED 0, SPEED 1, CODE_SIZE 2. Edition 2024 on. |
| Field | Name | Values |
|---|---|---|
| 1 | nullable_reference_types | bool: generated C# has nullable reference type annotations. Edition 2026 on; false by default. |
| Field | Name | Values |
|---|---|---|
| 1 | namespace | string: the C++ namespace of the generated classes; without it the package decides. Edition 2026 on. |
Their meanings and defaults are on Editions and features.
The protobuf repository publishes no schema for pb.python (1003) or
pb.enumvalue.json (998); the explorer names them and shows their contents
as raw fields.
Custom options
A custom option is an extension of an options message, declared in some
.proto file with extend google.protobuf.FileOptions and the
like. In a descriptor set it is a field of the options message with the extension’s
number. When the set also holds the file that declares the extension (an
extension entry whose extendee is the options message), the
explorer reads the option by that declaration and shows it by its name, such as
(my.package.my_option), with its type. An option declared in a file
outside the set stays a raw field.
FeatureSetDefaults
The defaults of each edition, which protoc --edition_defaults_out writes
as a binary file for runtimes and plug-ins. The explorer reads such a file when its
fields fit and it names a minimum and maximum edition.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | defaults | repeated FeatureSetEditionDefault | One entry for each edition that changes a default, oldest first. |
| 4 | minimum_edition | Edition | The oldest edition covered. |
| 5 | maximum_edition | Edition | The newest edition covered. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 3 | edition | Edition | The edition these defaults start at. |
| 4 | overridable_features | FeatureSet | Defaults a file may override. |
| 5 | fixed_features | FeatureSet | Values a file of this edition cannot change. |
SourceCodeInfo
Where each element is in the source, kept when protoc is given
--include_source_info. A location’s path is field numbers and
list indexes in turn, from FileDescriptorProto down: [4, 0, 2, 1] is
field 4 (message_type) item 0, then its field 2 (field) item
1. The explorer shows each path that way, as message_type[0].field[1].
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | location | repeated Location | The locations. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | path | repeated int32, packed | Field numbers and indexes leading to the element. |
| 2 | span | repeated int32, packed | Start line, start column, end line and end column. |
| 3 | leading_comments | string | The comment before it. |
| 4 | trailing_comments | string | The comment after it. |
| 6 | leading_detached_comments | repeated string | Earlier comments, not attached. |
GeneratedCodeInfo
Written beside generated code, not in descriptor sets. Maps generated code back to
.proto elements.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | annotation | repeated Annotation | The annotations. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | path | repeated int32, packed | Path to the element. |
| 2 | source_file | string | The source file. |
| 3 | begin | int32 | Where the code starts. |
| 4 | end | int32 | Where the code ends. |
| 5 | semantic | Semantic | NONE 0, SET 1, ALIAS 2. |
compiler/plugin.proto: the messages protoc exchanges with a plugin
google/protobuf/compiler/plugin.proto (package
google.protobuf.compiler, proto2) defines the two messages of a protoc plugin,
a program named protoc-gen-NAME. protoc writes a
CodeGeneratorRequest to the plugin’s standard input and reads a
CodeGeneratorResponse from its standard output, both as ordinary binary
messages. A captured request or response is therefore a .pb file, and the
explorer reads each by this schema.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | file_to_generate | repeated string | The files named on the command line; the plugin generates code for these only. |
| 2 | parameter | string | The generator parameter given on the command line (--NAME_opt, or the part of --NAME_out=parameter:dir before the colon). |
| 3 | compiler_version | Version | The version of protoc. |
| 15 | proto_file | repeated FileDescriptorProto | Descriptors of the files to generate and of everything they import, in topological order (a file comes before every file that imports it). Files to generate carry runtime-retention options only; the other files carry source-retention options too. protoc writes this field after the others, which the wire format does not guarantee. |
| 17 | source_file_descriptors | repeated FileDescriptorProto | The files to generate again, with all their options, source-retention options included. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | major | int32 | The major version of protoc. |
| 2 | minor | int32 | The minor version. |
| 3 | patch | int32 | The patch version. |
| 4 | suffix | string | A pre-release tag such as alpha, beta or rc; empty for a stable release. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | error | string | Not empty: generation failed, usually because of a fault in the .proto files. The plugin still exits with status 0; a problem in protoc itself goes to standard error with a non-zero status. |
| 2 | supported_features | uint64 | A bit mask of the Feature values the plugin supports. |
| 3 | minimum_edition | int32 | The lowest edition the plugin supports, as an Edition value (not an edition number). Used only when FEATURE_SUPPORTS_EDITIONS is set. |
| 4 | maximum_edition | int32 | The highest edition the plugin supports, in the same encoding. Used only when FEATURE_SUPPORTS_EDITIONS is set. |
| 15 | file | repeated File | The generated files. |
| Value | Name | Meaning |
|---|---|---|
| 0 | FEATURE_NONE | No optional feature is supported. |
| 1 | FEATURE_PROTO3_OPTIONAL | The plugin supports proto3 optional fields. |
| 2 | FEATURE_SUPPORTS_EDITIONS | The plugin supports editions, which makes minimum_edition and maximum_edition count. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | name | string | The path in the output directory: relative, written with /, with no . or .. part. Left out, the content continues the previous file, so a large file can be streamed. |
| 2 | insertion_point | string | Set: the content is inserted into an existing file at the line marked @@protoc_insertion_point(NAME), directly above it. Several insertions at one point appear in the order made; generators run in command-line order. name must also be set. |
| 15 | content | string | The text of the file. |
| 16 | generated_code_info | GeneratedCodeInfo | Describes the inserted or generated text; the offsets of an insertion are adjusted and merged into the file’s own generated-code information. |
The explorer takes a file as a request when field 1 holds the .proto names
to generate, and as a response when it holds an error text, files or supported
features and no .proto name; it shows the files to generate, the parameter,
the protoc version and each descriptor, or the error, the features, the editions and
each generated file.