How Do I Create a GTFS File?

A GTFS "file" is just a ZIP archive filled with simple CSV text files. You can create them using spreadsheets, text editors, or specialized tools.

  1. Gather the source data. Stop locations with latitude and longitude, route names and numbers, full timetables, the days each service runs, and basic agency details.
  2. Write the six required files. agency.txt, stops.txt, routes.txt, trips.txt, stop_times.txt and calendar.txt, as CSV.
  3. Package the files as a ZIP. Every .txt file at the root of the archive, not inside a folder.
  4. Validate before publishing. Check for typos in IDs, bad coordinates and wrong time formats before anyone downloads the feed.

What You'll Need

Before you start typing, make sure you have these details ready:

• Stop locations with GPS coordinates (latitude and longitude).

• Your route names and numbers.

• Full timetables (arrival times for every stop).

• Which days you operate (weekdays vs. weekends).

• Basic agency info like your website and timezone.

The Required Files

A minimal GTFS feed needs these six files. Every field below is defined in the GTFS Schedule reference, which is the authority if this page and the specification ever disagree:

1. agency.txt

agency_id,agency_name,agency_url,agency_timezone
mybus,My Bus Company,https://mybus.com,America/New_York

2. stops.txt

stop_id,stop_name,stop_lat,stop_lon
stop1,Main Street Station,40.7128,-74.0060
stop2,Central Park,40.7829,-73.9654

3. routes.txt

route_id,route_short_name,route_long_name,route_type
route1,42,Downtown Express,3

(route_type 3 = bus)

4. trips.txt

route_id,service_id,trip_id
route1,weekday,trip1
route1,weekday,trip2

5. stop_times.txt

trip_id,arrival_time,departure_time,stop_id,stop_sequence
trip1,08:00:00,08:00:00,stop1,1
trip1,08:30:00,08:30:00,stop2,2

6. calendar.txt

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
weekday,1,1,1,1,1,0,0,20240101,20241231

Tools to Create GTFS

Spreadsheets: Most people start with Excel or Google Sheets. Create a sheet for each file, and export them as "CSV UTF-8." It's the easiest way to manage columns.

Text Editors: If you're tech-savvy and your system is small, you can edit the CSV files directly in Notepad++ or VS Code.

Transit Software: If you use scheduling software, check if it has a "GTFS Export" button – many do!

Package Your Feed

Put all .txt files into a ZIP archive. The files must be at the root level (not inside a folder):

feed.zip
├── agency.txt
├── stops.txt
├── routes.txt
├── trips.txt
├── stop_times.txt
└── calendar.txt

Validate Before Publishing

Never publish without checking your work. Small typos can break your whole schedule. Look out for:

• Typos in ID names.

• Wonky GPS coordinates.

• Wrong time formats (always use HH:MM:SS).

Use GTFS Guru to catch these mistakes instantly before they reach your riders.

Next Steps

Once your feed validates without errors:

1. Host it at a public URL

2. Submit to Google Transit Partner Dashboard

3. Also submit to Apple Maps, Transit App, etc.

Related Questions

• What does GTFS stand for?

• How do I get my bus on Google Maps?

• Why was my GTFS feed rejected?

When the feed is packaged, validate it step by step.

Created your feed? Validate it for free before publishing.