GTFS
Convert from GTFSto any other format
The General Transit Feed Specification (GTFS), also called GTFS Schedule or GTFS Static, is the de facto open standard for publishing public-transport service data: routes, stops, schedules, and fares. It was created in 2005 by Google engineer Chris Harrelson, initially as a side project developed together with Portland's TriMet agency, which supplied its schedule as CSV files. Launched publicly in September 2006 as the "Google Transit Feed Specification," it was renamed in 2009 to drop the vendor association and is now maintained by the MobilityData organization as a community specification released under CC BY. It underpins trip planning in Google Maps, Apple Maps, and hundreds of independent transit apps.
A GTFS dataset is a ZIP archive containing a flat set of UTF-8, comma-delimited text files (extension .txt), each a relational table whose first line names the fields. Six tables are effectively required: agency, stops, routes, trips, stoptimes, and one of calendar or calendardates. Optional files cover shapes, transfers, frequencies, fares, pathways, and translations. The tables are joined by foreign keys into a clear hierarchy: a route (routes.txt) has many trips (trips.txt), and each trip is an ordered sequence of stop events in stoptimes.txt keyed by (tripid, stop_sequence), each referencing a stop (stops.txt) with WGS84 coordinates. Service calendars determine on which dates each trip runs. Times use an HH:MM:SS form that permits values past 24:00:00 to express service after midnight, and dates use YYYYMMDD. GTFS Static describes the planned timetable; the companion GTFS Realtime specification (Protocol Buffers) layers live delays, vehicle positions, and alerts on top of it.
Although GTFS is fundamentally a tabular relational format like CSV rather than a native graph serialization, its stop-time sequences form a directed spatiotemporal network, making it a common source for graph analysis and routing. Tools such as gtfs2nx and peartree build routable NetworkX graphs (adding walking transfers and headway-based costs), and gtfs2graph and libraries like City2Graph derive networks for centrality, accessibility, and isochrone studies. From there feeds can be exported to general graph formats such as GraphML or loaded into graph databases.
Its strengths are simplicity, wide adoption, and a low barrier to publishing. Its limitations are equally real: the schedule captures planned rather than actual service, so it omits reliability and real-world schedule adherence; the flat CSV model has weak native validation and no enforced referential integrity; and complex fare, frequency, and flexible on-demand services stretch a format originally designed for fixed-route timetables.
Alternative Names: General Transit Feed Specification, GTFS Schedule, GTFS Static
| Feature | GTFS (General Transit Feed Spec) |
|---|---|
| Nodes | |
| Undirected Edges | |
| Directed Edges | |
| Hyperedges | |
| Parallel Edges | |
| Self-loops | |
| Edges on Edges | |
| Nested Graphs in Nodes | |
| Nested Graphs in Edges | |
| Nested Graphs in Graphs | |
| Node Labels | |
| Attributes on Nodes | |
| Attributes on Edges | |
| Typed Edges | |
Read-only Tools
Frequently Asked Questions
What is a GTFS (General Transit Feed Spec) file?
A GTFS (General Transit Feed Spec) file stores a graph — its nodes, edges and attributes — in the GTFS (General Transit Feed Spec) format (also: General Transit Feed Specification, GTFS Schedule, GTFS Static). See the feature table above for what it supports.
How do I open a GTFS (General Transit Feed Spec) file?
Open it in a graph tool that supports GTFS (General Transit Feed Spec), or convert it to a format your tool reads. With GraphInOut you can convert GTFS (General Transit Feed Spec) to GraphML, DOT, Connected JSON and more, right in your browser.
How do I convert a GTFS (General Transit Feed Spec) file to another format?
Use the Convert from GTFS (General Transit Feed Spec) link above: upload or paste your GTFS (General Transit Feed Spec) file (input preset to GTFS (General Transit Feed Spec)), choose a target format and download the result — free, no install.
