How to Create a GTFS Feed from Scratch

What Is a GTFS Feed?

GTFS stands for General Transit Feed Specification. It is the global standard format for sharing public transit schedules and geographic data. When your agency has a GTFS feed, riders can look up your routes and departure times in Google Maps, Apple Maps, and dozens of other trip planning apps — without you building any app yourself.

A GTFS feed is a ZIP file containing a set of plain-text CSV files, each describing a different aspect of your service: your agency details, your stops, your routes, your timetables, and so on. This guide explains exactly what goes into each file and how to put them together.

What You Will Need Before You Start

  • Your agency name, website, and contact details
  • A list of every stop your vehicles use, with GPS coordinates (latitude and longitude)
  • Your route names and descriptions
  • Your timetables — which stops each route serves and at what times
  • Your service calendar — which days each route runs

You do not need to be a developer or know any programming. GTFS files are just structured text files, and tools like AddTransit let you enter this information through a simple web interface.

How long does it take?

A small agency with 2–5 routes can typically build their first GTFS feed in:

  • With AddTransit: 1–2 hours
  • Manually in spreadsheets: 1–3 days

The GTFS Files Explained

agency.txt — Your agency details

This file contains one row per agency. For most transit operators, that is just one row. It includes your agency name, website URL, and timezone. Getting this file right is essential because it is the first thing validators and mapping services check.

stops.txt — Your stops and stations

Each row in this file is one stop or station. You need a unique ID for each stop, its name, and its GPS coordinates (latitude and longitude). You can get coordinates by looking up each stop in Google Maps, right-clicking, and copying the numbers shown. Accuracy matters — if a stop is positioned in the wrong place, riders will be given wrong walking directions.

routes.txt — Your routes

Each row describes one route. Give it a unique ID, a short name (like "Route 12" or "Harbour Express"), a longer description, and a route type number. Route type 3 means bus; 4 is ferry; 2 is rail. You can also set the route colour here, which will appear in supported apps.

calendar.txt — Your service days

This file defines your service patterns — for example, "Monday to Friday" or "Weekends only". You give each pattern a service ID, tick which days it runs, and set the start and end dates. Most agencies have two or three patterns: a weekday service, a Saturday service, and perhaps a Sunday/public holiday service.

trips.txt — Individual journeys

Each row is one trip — one vehicle making one run along one route. You link each trip to a route ID and a service ID. You also set the direction (inbound or outbound) and can add a trip headsign, which is the destination name displayed on the front of the vehicle.

stop_times.txt — The timetable

This is the heart of your GTFS feed. Each row is one stop in one trip, with an arrival time and a departure time. A route with 10 stops and 20 daily trips will have 200 rows in this file. This file is where most manual errors occur, which is why using a platform that generates it from your input is strongly recommended.


Step-by-Step: Building Your GTFS Feed

Step 1 — Create your agency record

Start with agency.txt. Fill in your agency name exactly as you want it to appear in Google Maps, your website, and the timezone for your area (e.g., America/New_York or Europe/London).

Step 2 — Map your stops

List every stop your service uses in stops.txt. Even if two routes share a stop, you only list it once. Assign each stop a simple unique ID (like S001, S002) and record its coordinates carefully. A stop that is 50 metres out of position will cause Google Maps to route walkers to the wrong location.

Step 3 — Define your routes

Add each route to routes.txt. Keep the short name concise — it will appear in the Google Maps route badge. If you use route numbers, use those. If your routes have names, use those.

Step 4 — Set your service calendar

In calendar.txt, define when each service pattern operates. Set realistic future end dates — at least six months ahead, ideally twelve months. A calendar that expires sends your routes offline in trip planners.

Step 5 — Add your trips and stop times

Create a trip in trips.txt for every individual run. Then, in stop_times.txt, list every stop for every trip with arrival and departure times. For a stop where the bus does not wait, set arrival and departure times to the same value.

Step 6 — Validate and publish

Once your files are complete, zip them all together and run the feed through a validator. Fix any errors, then publish your feed to a public URL and submit it to Google Maps and other platforms. See our guide on how to validate a GTFS feed and our guide on how to publish to Google Maps.


The Easier Way: Use AddTransit

Building GTFS files by hand in a text editor or spreadsheet is error-prone and time-consuming. AddTransit provides a guided web interface where you enter your stops, routes, and timetables through simple forms — the platform generates all the correctly formatted files for you and validates them automatically. Most agencies have their GTFS feed created and ready within a day of signing up. Each journey planner — Google Maps, Apple Maps, and others — then has its own separate submission, review, and publishing process before your routes appear publicly.

Create your GTFS feed with AddTransit

Frequently Asked Questions

No. GTFS files are plain text CSV files that follow a defined structure. If you can use a spreadsheet, you can create GTFS manually. Using a platform like AddTransit removes even that requirement — you fill in online forms and the platform creates the files for you.

The easiest method is to open Google Maps, navigate to your stop location, right-click the exact spot, and select the coordinates that appear. AddTransit also has a built-in map interface where you can drop a pin to set stop coordinates without leaving the platform.

Creating a GTFS feed costs nothing in licensing fees — the specification is open and free to use. You may choose to use a free tool or a paid platform like AddTransit that speeds up the process and reduces errors. Submitting to Google Maps and most trip planners is also free.

There is no limit. A GTFS feed can contain one route or hundreds. Large transit authorities publish feeds covering entire regional networks. The structure scales to any size of operation.