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 .txt files 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

Common Use Cases

Use CaseExamples
Trip PlanningGoogle Maps, Apple Maps, Transit, Moovit, Citymapper
Mapping & VisualisationTransit route maps, stop location maps
Data AnalysisService coverage analysis, schedule adherence studies
Accessibility ToolsWheelchair-accessible route planning
Multi-Agency IntegrationRegional 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.

FieldRequiredDescription
agency_idOptional*Uniquely identifies the agency (required if multiple agencies exist)
agency_nameRequiredFull name of the agency
agency_urlRequiredURL of the agency's website
agency_timezoneRequiredTimezone of the agency (e.g. America/New_York)
agency_langOptionalPrimary language (e.g. en)
agency_phoneOptionalVoice phone number

2. stops.txt — Required

Locations where vehicles pick up or drop off passengers.

FieldRequiredDescription
stop_idRequiredUnique identifier
stop_codeOptionalShort code displayed on the stop
stop_nameRequiredName of the stop as known to passengers
stop_descOptionalDescription of the stop
stop_latRequiredLatitude (WGS 84)
stop_lonRequiredLongitude (WGS 84)
zone_idOptionalFare zone identifier
stop_urlOptionalURL with info about the stop
location_typeOptional0 = stop, 1 = station, 2 = entrance/exit, etc.
parent_stationOptionalParent 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.

FieldRequiredDescription
route_idRequiredUnique identifier
agency_idOptionalLinks to agency.txt (required if multiple agencies)
route_short_nameRequired*Short name (e.g. "M15")
route_long_nameRequired*Full name (e.g. "M15 - East Harlem - South Ferry")
route_descOptionalDescription of the route
route_typeRequired0 = tram, 1 = subway, 2 = rail, 3 = bus, 4 = ferry, etc.
route_urlOptionalURL with info about the route
route_colorOptionalHex colour for route rendering
route_text_colorOptionalHex 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.

FieldRequiredDescription
route_idRequiredLinks to routes.txt
service_idRequiredLinks to calendar.txt or calendar_dates.txt
trip_idRequiredUnique identifier
trip_headsignOptionalText displayed on the vehicle's sign
trip_short_nameOptionalShort identifier for passengers
direction_idOptional0 = one direction, 1 = opposite
block_idOptionalLinks trips that form a block (vehicle continues without returning)
shape_idOptionalLinks to shapes.txt
wheelchair_accessibleOptional0 = unknown, 1 = accessible, 2 = not accessible
bikes_allowedOptional0 = 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.

FieldRequiredDescription
trip_idRequiredLinks to trips.txt
arrival_timeRequired*Arrival time in HH:MM:SS format (can exceed 24:00 for overnight trips)
departure_timeRequired*Departure time in HH:MM:SS format
stop_idRequiredLinks to stops.txt
stop_sequenceRequiredOrder of stops in the trip
stop_headsignOptionalText displayed at this stop
pickup_typeOptional0 = regular, 1 = no pickup, 2 = phone agency, 3 = coordinate with driver
drop_off_typeOptionalSame semantics as pickup_type
shape_dist_traveledOptionalDistance from the start of the shape
timepointOptional0 = 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.

FieldRequiredDescription
service_idRequiredUnique identifier (referenced by trips.txt)
mondaysundayRequired0 or 1 for each day of the week
start_dateRequiredStart date in YYYYMMDD format
end_dateRequiredEnd date in YYYYMMDD format

7. calendar_dates.txt — Required* (see note)

Exceptions to the calendar — explicit service additions or removals for specific dates.

FieldRequiredDescription
service_idRequiredLinks to calendar.txt
dateRequiredDate in YYYYMMDD format
exception_typeRequired1 = service added, 2 = service removed

Note: Either calendar.txt or calendar_dates.txt is required. Using both together is common.


Key Optional Files

FilePurpose
shapes.txtGeographic path of a trip (polyline of lat/lon points)
frequencies.txtHeadway-based schedules (service every X minutes)
transfers.txtTransfer rules between stops or routes
pathways.txtIndoor pathways within stations (stairs, elevators, etc.)
levels.txtFloor/level information within stations
fare_attributes.txtFare pricing information
fare_rules.txtRules mapping fares to zones, routes, etc.
feed_info.txtMetadata about the feed (publisher, version, language)
translations.txtTranslated text for stop names, route names, etc.
attributions.txtData attribution and licensing
areas.txtGeographic areas for fare or service rules (fares v2)
fare_leg_rules.txtPer-leg fare rules (fares v2)
fare_products.txtFare product definitions (fares v2)
fare_transfer_rules.txtTransfer fare rules (fares v2)
networks.txtRoute network groupings
route_networks.txtAssignment of routes to networks
booking_rules.txtRules for demand-responsive booking
locations.geojsonGeographic areas in GeoJSON format

Dataset Publishing Best Practices


References