> ## Content Index
> Fetch the complete content index at: https://datajutsu.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Proto3 vs Proto2: What Actually Changes on the Wire (Mostly Nothing)
- URL: https://datajutsu.com/proto3-vs-proto2/
- Published: 2026-10-21T20:40:04.000Z
- Updated: 2026-10-21T20:40:04.000Z
- Author: Data Jutsu

Most of the time you will never have to think about it, and then one day you open an old .proto, see syntax = "proto2", and everything you assumed about defaults and field presence is suddenly load-bearing. So here is the version that actually matters, because the wire format is the same in both. The bytes on the wire carry field numbers and wire types, and those work identically in proto2 and proto3\. A proto3 client reads proto2 bytes fine, and the reverse is true, as long as the field numbers and types agree. I checked this against real encode/decode: the same field in both files produces the same tag, and a message encoded by one decodes back to the exact same values on the other. The syntax line does not change what the bytes mean.

What it does change is what happens when a field is missing. In proto3 a missing integer field is 0, a missing string is the empty string, a missing bool is false, and the decoder just fills it in, because proto3 says a field that is not on the wire holds its default. In proto2, the field is simply not set, and a generator or a decoder that tracks presence can tell the difference between an explicitly sent zero and a zero that was never there. That distinction is the whole reason proto3 got explicit optional, and it matters when a zero means something, like a status code or a port number, because now you cannot tell whether the sender sent zero or said nothing. If your schema has ever had that bug, this is the bug.

Then there is packing. In proto3, a repeated field of a scalar type is packed by default, one tag, one length, all the values in a run, 1a 03 01 02 03 for three integers. In proto2, the same field is unpacked by default, one tag per value, 18 01 18 02 18 03\. Same data, different byte count, and if you flip a file between the two without saying so, every message that uses that field changes size on the wire and old and new versions are still reading each other fine, because packing is a choice of how you write, not of what you mean. The decoder handles both shapes for both syntaxes. What trips people up is the diff: the bytes changed, nothing in the schema changed, and a tool that compares bytes instead of values will call it a difference.

And defaults. proto2 lets you set them, optional int32 count = 1 \[default = 5\], and that default is real, a missing field decodes as 5 in a runtime that honors it. proto3 does not take default options on ordinary fields, the default is whatever the type's zero value is, full stop. So a schema migration is not just a syntax line, it is a behavior change hiding in every field that relied on a non-zero default, and the fix is not to add the option back, it is to make the default explicit in code or in the data.

The practical question is when you migrate, and the answer is that the wire will not stop you. Old clients keep talking to new servers across the flip, because the flip does not touch field numbers. What does touch them is the review of every field's semantics: which zeros were real values, which repeated fields are now packed, which optional meant something. That review is mechanical and easy to get wrong by hand, which is why a tool is the right shape for it. The converter at [proto.datajutsu.com](https://proto.datajutsu.com/?ref=datajutsu.com) parses both syntaxes and does not care which one you paste, and the Diff tab will take your pre-migration and post-migration .proto and give you the field-by-field list, so the syntax change itself shows up as no changes, which is exactly the reassurance you want, while any field that actually changed meaning shows up as its own line.

Keep three rules and the migration is boring. Field numbers and types are the contract, keep them, and the syntax line is free to move. Any field where the zero value was doing work gets a real decision, explicit optional in proto3 or an honest default in code. Any repeated scalar you touch gets a packing decision, and you make it once, deliberately, not by inheritance from whichever syntax the file happens to be in. Do that, and proto2 to proto3 stops being a scary rewrite and becomes what it actually is, a change of defaults, with the wire staying put.