What Is GTFS Schedule?
GTFS Schedule (General Transit Feed Specification — formerly "GTFS static") is the open standard for publishing public transportation schedules and associated geographic information. It defines a common data format that transit agencies use to describe their fixed-route services — stops, routes, trips, schedules, fares, and more.
Developed originally through a partnership between Google and the transit industry, GTFS is now maintained by MobilityData and governed by an open community process.
File format: A GTFS Schedule dataset is a ZIP archive containing multiple
.txtfiles in CSV-like format. The files must be at the root of the archive, not in subdirectories.Encoding: All files must be UTF-8 encoded. Byte Order Mark (BOM) characters are not allowed.
Current version: The specification is maintained at gtfs.org. The latest reference is available in the GTFS Schedule Reference.
What GTFS Schedule Does
- Describes transit networks: stops, routes, trips, and their schedules
- Enables trip planning: apps like Google Maps, Apple Maps, Transit, Moovit use GTFS to plan journeys
- Standardises fare data: fare attributes, zones, transfer rules
- Supports accessibility: wheelchair-accessible stops and trips, text-to-speech names
- Handles complex service patterns: regular calendars, exceptions, frequency-based schedules
Common Use Cases
| Use Case | Examples |
|---|---|
| Trip Planning | Google Maps, Apple Maps, Transit, Moovit, Citymapper |
| Mapping & Visualisation | Transit route maps, stop location maps |
| Data Analysis | Service coverage analysis, schedule adherence studies |
| Accessibility Tools | Wheelchair-accessible route planning |
| Multi-Agency Integration | Regional transit authorities combining feeds |
Core Files
A GTFS Schedule dataset consists of a set of files. At minimum, a valid feed includes 7 required files. Below is a summary of each file, its purpose, and key fields.
1. agency.txt — Required
One or more transit agencies that operate the services.
| Field | Required | Description |
|---|---|---|
agency_id | Optional* | Uniquely identifies the agency (required if multiple agencies exist) |
agency_name | Required | Full name of the agency |
agency_url | Required | URL of the agency's website |
agency_timezone | Required | Timezone of the agency (e.g. America/New_York) |
agency_lang | Optional | Primary language (e.g. en) |
agency_phone | Optional | Voice phone number |
2. stops.txt — Required
Locations where vehicles pick up or drop off passengers.
| Field | Required | Description |
|---|---|---|
stop_id | Required | Unique identifier |
stop_code | Optional | Short code displayed on the stop |
stop_name | Required | Name of the stop as known to passengers |
stop_desc | Optional | Description of the stop |
stop_lat | Required | Latitude (WGS 84) |
stop_lon | Required | Longitude (WGS 84) |
zone_id | Optional | Fare zone identifier |
stop_url | Optional | URL with info about the stop |
location_type | Optional | 0 = stop, 1 = station, 2 = entrance/exit, etc. |
parent_station | Optional | Parent station for hierarchical stops |
Example:
stop_id,stop_code,stop_name,stop_lat,stop_lon,zone_id
S1,101,Main Street & 5th Ave,40.712776,-74.005974,Z1
S2,102,Broadway & 42nd St,40.759011,-73.984472,Z1
3. routes.txt — Required
Transit routes. A route is a group of trips displayed to passengers as a single service.
| Field | Required | Description |
|---|---|---|
route_id | Required | Unique identifier |
agency_id | Optional | Links to agency.txt (required if multiple agencies) |
route_short_name | Required* | Short name (e.g. "M15") |
route_long_name | Required* | Full name (e.g. "M15 - East Harlem - South Ferry") |
route_desc | Optional | Description of the route |
route_type | Required | 0 = tram, 1 = subway, 2 = rail, 3 = bus, 4 = ferry, etc. |
route_url | Optional | URL with info about the route |
route_color | Optional | Hex colour for route rendering |
route_text_color | Optional | Hex colour for text on the route |
* At least one of route_short_name or route_long_name must be provided.
4. trips.txt — Required
Trips for each route. A trip is a sequence of stops at specific times.
| Field | Required | Description |
|---|---|---|
route_id | Required | Links to routes.txt |
service_id | Required | Links to calendar.txt or calendar_dates.txt |
trip_id | Required | Unique identifier |
trip_headsign | Optional | Text displayed on the vehicle's sign |
trip_short_name | Optional | Short identifier for passengers |
direction_id | Optional | 0 = one direction, 1 = opposite |
block_id | Optional | Links trips that form a block (vehicle continues without returning) |
shape_id | Optional | Links to shapes.txt |
wheelchair_accessible | Optional | 0 = unknown, 1 = accessible, 2 = not accessible |
bikes_allowed | Optional | 0 = unknown, 1 = bikes allowed, 2 = not allowed |
5. stop_times.txt — Required
The times at which a trip arrives at and departs from each stop.
| Field | Required | Description |
|---|---|---|
trip_id | Required | Links to trips.txt |
arrival_time | Required* | Arrival time in HH:MM:SS format (can exceed 24:00 for overnight trips) |
departure_time | Required* | Departure time in HH:MM:SS format |
stop_id | Required | Links to stops.txt |
stop_sequence | Required | Order of stops in the trip |
stop_headsign | Optional | Text displayed at this stop |
pickup_type | Optional | 0 = regular, 1 = no pickup, 2 = phone agency, 3 = coordinate with driver |
drop_off_type | Optional | Same semantics as pickup_type |
shape_dist_traveled | Optional | Distance from the start of the shape |
timepoint | Optional | 0 = approximate, 1 = exact |
* arrival_time and departure_time are conditionally required — see the reference for details.
Example:
trip_id,arrival_time,departure_time,stop_id,stop_sequence
T1,08:00:00,08:00:00,S1,1
T1,08:05:00,08:05:30,S2,2
T1,08:12:00,08:12:00,S3,3
6. calendar.txt — Required
Service schedules — which days of the week a service operates and the start/end date.
| Field | Required | Description |
|---|---|---|
service_id | Required | Unique identifier (referenced by trips.txt) |
monday–sunday | Required | 0 or 1 for each day of the week |
start_date | Required | Start date in YYYYMMDD format |
end_date | Required | End date in YYYYMMDD format |
7. calendar_dates.txt — Required* (see note)
Exceptions to the calendar — explicit service additions or removals for specific dates.
| Field | Required | Description |
|---|---|---|
service_id | Required | Links to calendar.txt |
date | Required | Date in YYYYMMDD format |
exception_type | Required | 1 = service added, 2 = service removed |
Note: Either
calendar.txtorcalendar_dates.txtis required. Using both together is common.
Key Optional Files
| File | Purpose |
|---|---|
shapes.txt | Geographic path of a trip (polyline of lat/lon points) |
frequencies.txt | Headway-based schedules (service every X minutes) |
transfers.txt | Transfer rules between stops or routes |
pathways.txt | Indoor pathways within stations (stairs, elevators, etc.) |
levels.txt | Floor/level information within stations |
fare_attributes.txt | Fare pricing information |
fare_rules.txt | Rules mapping fares to zones, routes, etc. |
feed_info.txt | Metadata about the feed (publisher, version, language) |
translations.txt | Translated text for stop names, route names, etc. |
attributions.txt | Data attribution and licensing |
areas.txt | Geographic areas for fare or service rules (fares v2) |
fare_leg_rules.txt | Per-leg fare rules (fares v2) |
fare_products.txt | Fare product definitions (fares v2) |
fare_transfer_rules.txt | Transfer fare rules (fares v2) |
networks.txt | Route network groupings |
route_networks.txt | Assignment of routes to networks |
booking_rules.txt | Rules for demand-responsive booking |
locations.geojson | Geographic areas in GeoJSON format |
Dataset Publishing Best Practices
- Publish the feed at a public, permanent URL (e.g.
www.agency.org/gtfs/gtfs.zip) - The URL should be directly downloadable without authentication when possible
- Datasets should cover at least the next 7 days of service, ideally 30+ days
- Use stable identifiers (
stop_id,route_id,agency_id) across iterations - Remove expired calendars from the feed
- Use Mixed Case for passenger-facing text (e.g. "Brighton Churchill Square" not "BRIGHTON CHURCHILL SQUARE")
- Avoid abbreviations in names unless the location is known by the abbreviation (e.g. "JFK Airport")
- Validate your feed using community tools before publishing
References
- GTFS Schedule Reference (Canonical): https://gtfs.org/documentation/schedule/reference/
- GTFS Schedule Best Practices: https://gtfs.org/documentation/schedule/schedule-best-practices/
- Google's GTFS Schedule Reference (with Google-specific differences): https://developers.google.com/transit/gtfs/reference/
- GTFS GitHub Repository (google/transit): https://github.com/google/transit
- MobilityData (GTFS Steward): https://mobilitydata.org/
- GTFS.org (Home of the Standard): https://gtfs.org/
- Producing GTFS Data: https://gtfs.org/resources/producing-data/
- Example GTFS Feed: https://gtfs.org/documentation/schedule/example-feed/