MTA Realtime Transit Feed to JSON Converter
Decode MTA GTFS Realtime protobuf binary feeds to JSON directly in your browser. No server, no API key needed for local files.
Drop a .pb / .bin file here or click to browse
GTFS Realtime protobuf binary • Max 50 MB
About
MTA GTFS Realtime feeds are distributed as Protocol Buffer binaries conforming to the gtfs-realtime.proto schema. Decoding these in a browser has historically required either a server-side proxy or a bulky protobuf library. This tool implements a complete protobuf wire format decoder in pure JavaScript, parsing LEB128 varints, length-delimited fields, and fixed-width values directly from the binary. Drop a .pb or .bin file and receive structured JSON mapped to GTFS Realtime field names: FeedMessage, TripUpdate, VehiclePosition, Alert, and all nested descriptors. The decoded JSON output is typically 5Γ to 15Γ larger than the source binary. This tool approximates field types based on the canonical GTFS-RT proto definition. Custom extensions or non-standard fields decode as raw wire-type values with numeric field IDs preserved.
Formulas
Protocol Buffer fields are encoded as a tag-value pair. The tag is a varint combining the field number and wire type:
Extracting the components:
Varints use LEB128 encoding. Each byte contributes 7 bits of payload. The MSB indicates continuation:
Signed integers use zigzag encoding to keep small negative numbers compact:
Where tag is the encoded field identifier, field_number is the proto schema field index, wire_type is one of {0, 1, 2, 5}, bytei is the i-th byte of the varint, and n is the unsigned varint value before zigzag decode.
Reference Data
| Feed ID | MTA Subway Lines | Endpoint Suffix | Approx. Update Interval | Typical Binary Size |
|---|---|---|---|---|
| 1 | 1, 2, 3, 4, 5, 6, S (42nd) | gtfsrt/1 | 30 s | 200 - 800 KB |
| 26 | A, C, E | gtfsrt/26 | 30 s | 150 - 600 KB |
| 16 | N, Q, R, W | gtfsrt/16 | 30 s | 100 - 500 KB |
| 21 | B, D, F, M | gtfsrt/21 | 30 s | 100 - 500 KB |
| 2 | L | gtfsrt/2 | 30 s | 20 - 100 KB |
| 11 | SIR (Staten Island Railway) | gtfsrt/11 | 30 s | 10 - 50 KB |
| 31 | G | gtfsrt/31 | 30 s | 20 - 80 KB |
| 36 | J, Z | gtfsrt/36 | 30 s | 30 - 120 KB |
| 51 | 7 | gtfsrt/51 | 30 s | 20 - 100 KB |
| Wire Types in Protocol Buffers | ||||
| 0 | Varint (int32, int64, uint32, uint64, sint32, sint64, bool, enum) | LEB128 variable-length encoding | ||
| 1 | 64-bit (fixed64, sfixed64, double) | Fixed 8 bytes, little-endian | ||
| 2 | Length-delimited (string, bytes, embedded messages, packed repeated) | Varint length prefix + payload | ||
| 5 | 32-bit (fixed32, sfixed32, float) | Fixed 4 bytes, little-endian | ||
| GTFS Realtime Entity Types | ||||
| TripUpdate | Predicted arrival/departure times for stops along a trip | |||
| VehiclePosition | Current geographic position and status of a vehicle | |||
| Alert | Service alerts affecting routes, stops, or the network | |||
| Common GTFS-RT Enum Values | ||||
| 0 | ScheduleRelationship | SCHEDULED | ||
| 1 | ScheduleRelationship | ADDED | ||
| 2 | ScheduleRelationship | UNSCHEDULED | ||
| 3 | ScheduleRelationship | CANCELED | ||
| 0 | VehicleStopStatus | INCOMING_AT | ||
| 1 | VehicleStopStatus | STOPPED_AT | ||
| 2 | VehicleStopStatus | IN_TRANSIT_TO | ||