Avro to Protobuf
Convert an Avro schema to a Protocol Buffers .proto3 definition in your browser, no upload
Input
Output
Paste your Avro on the left and the Protobuf shows up here.
Or drop a file on this box, , or .
What does Avro to Protobuf do?
Data that sits in a Kafka topic as Apache Avro often has to be served by a gRPC service next, and gRPC wants Protocol Buffers. Retyping a 30-field .avsc as a .proto by hand is exactly how a long slips through as an int32. Paste the schema here and you get a syntax = "proto3" file back: a message for each Avro record, an enum for each Avro enum, int as int32, long as int64, arrays as repeated fields and maps as map<string, V>.
The converter walks the schema tree and emits messages depth-first, so nested types are defined before the parents that reference them. Avro unions like ["null", "Address"] resolve to the non-null branch, Address in this case, because Protobuf has no exact equivalent of nullable unions in proto3 (every singular field is implicitly nullable). The output is well-formed proto3 source you can drop straight into protoc, see the proto3 language guide for the syntax rules.
It runs in your browser. No upload, no schema stored, no telemetry.
How to Use Avro to Protobuf
The .proto pane regenerates a moment after every edit, so you can change a field type on the left and watch the matching message line change on the right.
Paste, Upload, or Load a Sample
Paste the .avsc into Input, load one from disk with Upload, or press Sample. The sample is an Order holding a list of OrderItem records, a Currency enum and an optional Address, so one paste yields four definitions. Even a small schema like this shows the namespace becoming the package line and the enum symbols numbered from 0:
{"type":"record","name":"Payment","namespace":"com.acme.billing","fields":[{"name":"paymentId","type":"string"},{"name":"amountCents","type":"long"},{"name":"method","type":{"type":"enum","name":"PaymentMethod","symbols":["CARD","SEPA","PAYPAL"]}}]} The schema must be valid JSON in .avsc form, per the Avro 1.11 specification. If you have a binary .avro Object Container File, run avro-tools getschema first to extract the JSON schema, then paste it here.
Read the .proto Output
The right Output panel shows a syntax = "proto3" definition with one message per Avro record and one enum per Avro enum. Field tag numbers start at 1 and follow the field order in the source schema. The package line uses the Avro namespace when present; otherwise it falls back to avro.example.
Copy or Download
Hit Copy to grab the .proto for a gRPC service or a Schema Registry Protobuf entry. Hit Download to save as output.proto. Review the field numbers and any heuristic mappings (logical types, unions) before passing it to protoc: see the FAQ below for the gotchas.
When You'd Actually Use This
Migrating Kafka to gRPC
You have an Avro-based Kafka topic feeding a downstream service that you are now exposing over gRPC. Convert the topic's Avro schema to .proto3 here, hand-tune the field tags and any logical types, generate code with protoc, point the gRPC service at the same data shape.
Cross-Format Schema Documentation
Your team owns the Avro schema as the source of truth, but the consumer team works in Protobuf. Generate the .proto mirror so both sides have a definition in their preferred language: same shape, same field names, just different syntax.
Protobuf Schema Skeleton
You are designing a new Protobuf message and the data shape already exists as an Avro schema in another repo. Generate the skeleton from the Avro source, then iterate on it directly: saves you from typing out 30 fields by hand and getting one of them wrong.
Avro-to-Protobuf Bridges
Building or debugging a piece of middleware that translates Avro records to Protobuf messages on the fly. Having the two schemas side-by-side, generated from the same source, makes the field-mapping logic much easier to verify.
Common Questions
Do timestamp-millis and decimal fields turn into Protobuf well-known types?
No. The converter keeps the physical type underneath, so a timestamp-millis field declared on long ends up as int64 and a decimal on bytes stays bytes. If you want Protobuf well-known types like google.protobuf.Timestamp or a custom Decimal message, swap them in by hand. The converter does not import timestamp.proto for you because that imposes opinions on your file layout.
How are Avro unions handled?
Nullable unions (["null", T]) resolve to T, since proto3 singular fields are nullable by default. Non-nullable multi-branch unions (["int", "string"]) pick the first branch: Protobuf oneof would be the better fit, but generating oneof automatically requires field-grouping decisions the converter cannot guess. Tweak the output by hand if you need oneof.
Are field tag numbers stable across runs?
They are sequential by field order in the input: first field is = 1, second is = 2, and so on. If you reorder fields in the Avro schema, the numbers shift, which would be a wire-incompatible change in real Protobuf. Once you commit the .proto to a repo, freeze the numbers and stop regenerating from Avro for that file.
Does the output compile with protoc as-is?
Usually yes for straightforward record/enum/array schemas. Edge cases that may need a hand-edit: Avro field names that collide with Protobuf reserved words, deeply recursive named types, fixed-size types (fixed) which become bytes without the size constraint, and unions that need to be expressed as oneof. Always run protoc --proto_path=. file.proto as a smoke test.
Is the schema sent to a server?
No. The walk that turns records into messages and enums into enums runs in this tab with no request behind it, so an unreleased event schema is fine to paste. Once the page has loaded it keeps working with the network unplugged.
What about Avro maps and arrays?
Avro {"type": "array", "items": T} becomes repeated T field_name = N;. Avro {"type": "map", "values": V} becomes map<string, V> field_name = N;: Avro maps are always string-keyed, which lines up with the most common Protobuf map shape. See the maps section of the proto3 guide for the wire-format implications.
Other Avro and Protobuf Tools
A generated .proto is usually one stop in a migration. Validate the Avro side first, or turn sample records into JSON for the gRPC team, with these: