Skip to main content

Protobuf Field Number Tracker

Paste your .proto file and instantly audit field numbers. Detects duplicates, reserved range violations, Google reserved numbers (19000-19999), and encoding efficiency.

✓ Conflict detection ✓ Reserved range validation ✓ 1-byte vs 2-byte encoding hints ✓ Runs 100% in your browser

Frequently Asked Questions

Why do Protobuf field numbers matter?▼

Field numbers in Protocol Buffers are used for binary encoding — they identify fields in the serialized wire format, not names. Changing a field number is a breaking change: old clients and new clients will misread each other's data. Numbers 1-15 use one byte encoding, 16-2047 use two bytes — so frequently used fields should get low numbers.

What field numbers are reserved by Google?▼

Field numbers 19000 through 19999 are reserved by the Protocol Buffers implementation for internal use. Using them will produce a compile-time error in protoc. Numbers must also be positive integers between 1 and 536870911 (2^29 - 1).

What does 'reserved' mean in proto files?▼

The 'reserved' keyword prevents reuse of field numbers or names that were previously used by removed fields. This avoids accidental reuse which would cause data corruption when old serialized data is parsed by new code. Example: reserved 2, 15, 9 to 11; or reserved "foo", "bar";

How do I handle field number conflicts?▼

Each field in a message must have a unique field number. If you rename a field, the number stays the same (that's fine). If you remove a field, mark its number as reserved. Never reuse field numbers in the same message — the binary wire format uses the number as the field identifier.

What is the difference between proto2 and proto3 field rules?▼

In proto2, fields have explicit rules: required, optional, or repeated. In proto3, all singular fields are implicitly optional and the 'optional' keyword was only re-added in proto3 optional syntax. This tool handles both syntaxes and parses fields correctly regardless of label style.

Which fields should get numbers 1-15?▼

Fields you expect to be present in most messages — typically IDs, status flags, timestamps, and primary data payloads. Fields 1-15 encode in 1 byte vs 2 bytes for 16-2047, which can matter at scale. Map fields, repeated nested messages, and rarely-set optional fields can safely use higher numbers.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →