Protobuf to TypeScript Interfaces
Converts .proto messages and enums into TypeScript interfaces and types that match the proto3 JSON mapping: nested messages as Outer_Inner, repeated as arrays, map as Record. Services are ignored.
Use the tool
Why this tool exists
A browser client that talks to a gRPC-Web gateway or a JSON transcoding proxy receives plain JSON, not binary protobuf. It still helps to have types for those payloads. Full generators such as protoc plugins are the right tool for production, but they need setup, and sometimes you only want the data shapes for a quick script or review. Paste the messages here and get interfaces following the JSON mapping: camelCase fields, int64 as string or number as you choose, Timestamp as a string, oneof members optional and enums as string unions or TypeScript enums. Services and RPC definitions are ignored. The conversion runs in your browser.
How to use it
- Paste the .proto source into the input box.
- Choose camelCase names, how 64-bit integers are typed, and whether to emit TypeScript enums.
- Copy the interfaces into your project.
Frequently asked questions
How are nested messages named?
A message Inner declared inside Outer becomes the interface Outer_Inner. That avoids name clashes between nested messages with the same name and keeps their origin visible in the output.
How are repeated and map fields typed?
Repeated fields become arrays of the element type, and map fields become Record types that carry the key and value types, which matches how the JSON mapping represents them.
What happens to oneof?
Each member of a oneof becomes an optional property, because in a real message at most one of them is present. Your code can check which one is set before using it.
Does it generate gRPC client code?
No. Services and RPC methods are ignored. It only produces data types, so use protoc or ts-proto for client code.