TransitFare

What Is GTFS? A Guide for Small Agencies

Required, six files Optional, as needed agency.txt Who runs it stops.txt Where stops are routes.txt Route names trips.txt Each run stop_times.txt Arrival times calendar.txt Which days calendar_dates.txt can replace it shapes.txt Street path fare_rules.txt Fare prices feed_info.txt Version frequencies.txt Headways transfers.txt Transfers And more in the spec

A rider in your service area opens Google Maps. They type in a destination two miles from a stop your agency runs every thirty minutes. Google gives them driving directions. Not a bus icon, not a wrong time, nothing at all. Google has no idea your route exists, so the rider drives.

That gap has a name. It is the General Transit Feed Specification, or GTFS. What is GTFS, exactly? This guide answers that in full. It covers what the standard contains and what a small agency without a scheduling department has to do to publish it. It also covers what it costs a transit system to stay invisible to the trip planners riders already trust.

What Is GTFS?

The General Transit Feed Specification (GTFS) is an open data standard that describes a transit system’s routes, stops, and schedules as a set of plain text files. An agency publishes those files as one zip archive at a public URL. Any application that reads GTFS, including Google Maps, Apple Maps, and transit apps, can then show that agency’s service to riders automatically.

GTFS was created by Google and Portland’s TriMet in 2005. It is now maintained as an open, community-governed standard by MobilityData, a nonprofit built for exactly that purpose. No single vendor owns it, and no agency pays to use it.

What a GTFS Dataset Actually Contains

A GTFS dataset is not a database. It is not a live connection to anything. It is a zip file holding a set of comma-delimited text files. Each is named for what it describes: stops, routes, trips, and the times a vehicle is due at each stop. Open the zip and every file reads like a spreadsheet, because most agencies build them from one.

The gtfs.org schedule reference lists more than a dozen possible files. Only a handful are required to make a valid feed. The rest are optional, and which ones are worth building depends on the size of the system and what riders actually need to see. That split, required versus optional, is the structure the rest of this guide follows.

The Required Files

Six files make a typical fixed-route GTFS feed valid, per the gtfs.org schedule reference. (One exception: calendar.txt can be replaced by listing every service date in calendar_dates.txt.) Miss one, or leave a required field blank inside one, and most consumer applications reject the whole feed instead of showing a partial system.

agency.txt

One row identifies the transit agency: its name, its public website, and its time zone, per gtfs.org’s agency.txt reference. Small agencies most often get the time zone field wrong, or leave it inconsistent with how their scheduling software exports times. That throws off every arrival time once a realtime feed sits on top of it. An agency that later adds a second brand, a paratransit service under a different name, also needs agency_id set correctly on every route.

stops.txt

Every stop and station gets a row with an ID, a name, and coordinates. The most common error is not a missing field. It is drift: a stop entered once years ago, copied forward through a decade of edits, ends up a hundred feet from where the pole actually stands. That is enough for a validator to flag the stop as too far from its route path.

routes.txt

Each route needs an ID, a short or long name, and a route type, per the route_type enum. The route type is the number that tells a consumer whether this is a bus, a streetcar, or a ferry. Agencies running one mode rarely get the type wrong. What drifts is naming: the route number on the headsign and the route_short_name field in the feed, after a renumbering that never made it into the export.

trips.txt

A trip is one scheduled run of a vehicle along a route on a given day. This file links a trip to its route and to a service pattern in calendar.txt. The field agencies skip most is shape_id. It is optional, but without it a consumer draws a straight line between stops instead of the real street path. A route that loops or backtracks looks wrong on the map even when the schedule underneath it is correct.

stop_times.txt

This is the largest file in almost every feed: one row for every stop on every trip, with an arrival and departure time. Trips that run past midnight are the classic small-agency trap. GTFS expects a time like 25:30:00 for 1:30 AM the next service day, not a reset to 01:30:00. A feed built by hand in a spreadsheet gets this wrong constantly.

calendar.txt

Calendar.txt defines which days of the week each service pattern runs, and the date range it is valid for, per gtfs.org’s calendar.txt reference. The single most common failure is not renewing the end date. A feed with an expired end_date still validates and still sits at its URL. It also silently disappears from Google Maps the day after it lapses, because Google will not show a schedule it cannot confirm is current.

The Optional Files That Matter

Beyond the six required files, GTFS defines several optional ones. At 25 buses, building all of them is rarely worth the effort. A few are worth it anyway.

FileWhat it addsWorth it at small scale?
shapes.txtThe actual street path a vehicle follows, so the route draws correctly instead of straight-lining between stopsUsually yes. One clean GPS trace per route covers it
fare_attributes.txt / fare_rules.txtFlat or zone-based fare prices tied to routesYes if fares are simple. A single flat fare often needs only a few rows
feed_info.txtPublisher name, publisher URL, feed language, and versionYes, always. One row, and the only place a feed’s publisher and version are machine-readable
frequencies.txtHeadway-based service, a bus every 15 minutes, instead of fixed clock timesOnly if service genuinely runs on headways rather than a published timetable
transfers.txtMinimum transfer time between two stops or routesOnly with a real timed-transfer hub

feed_info.txt is technically optional and functionally not. Google’s static feed guidance treats a stale or missing feed as a warning-generating problem. A file that takes five minutes to build is a poor place to lose points on a feed that took weeks to get right.

GTFS Schedule and GTFS-Realtime

Everything described so far is GTFS Schedule, sometimes called GTFS Static: the planned timetable, published in advance and updated when service changes. It answers “what should be running.” It does not answer “where is the bus right now” or “is this route detoured today,” and riders act on both questions constantly.

That second half is General Transit Feed Specification-Realtime (GTFS-Realtime, or GTFS-RT). It is three separate live feeds, vehicle positions, trip updates, and service alerts, published continuously rather than once per season. GTFS-Realtime, explained covers what each feed carries, and what a rider actually sees when an agency publishes only one or two of the three instead of all of them.

Example: Route 5 GTFS Schedule What should run GTFS-Realtime What is running now 08:14 Main St at 2nd 08:22 5th and Oak 08:31 Transit Center Published 2 to 4 times a year Vehicle positions Trip updates Service alerts Published about every 30 seconds

How Does a GTFS Feed Get Published?

A GTFS feed gets published in four moves. Export the schedule into the required files, and zip them at the root of the archive. Host that zip at a stable public URL that never changes. Then register the URL with each consumer, starting with Google’s Transit Partner Program. The feed only helps riders once a consumer has actually crawled it.

That path has more failure points than agencies expect. A validator error can block submission before it starts. Reviews can come back with a rejection instead of an approval. And a feed URL can quietly change during a website redesign, breaking every consumer pointed at the old one. The zip itself has its own quiet requirement: the required files belong at the root of the archive, not inside a nested folder, or several consumers will fail to find them at all. How to publish GTFS data to Google Maps walks through the full submission procedure, including the six most common rejection reasons and the fix for each.

Schedule Routes, stops, times GTFS zip Required files at the root Stable URL One address, never moves Google Maps Apple Maps Transit apps No feed: the rider gets driving directions

Who Consumes Your Feed

A published GTFS feed does not go to one place. It goes to whoever chooses to read it, and in practice that is a short, well-known list.

Google Maps and Apple Maps are the two a rider most likely already has open. Both accept a submitted feed URL, and both re-crawl it periodically rather than continuously. That is part of why a stale end date or a moved URL makes routes vanish days after the actual problem happened. Where a service area overlaps a neighboring agency, keeping shared stop names and codes consistent between the two feeds also matters. Google Maps merges overlapping data from multiple publishers, and mismatched naming at a shared stop can confuse a rider transferring between systems.

Third-party transit apps, the standalone trip planners riders install specifically for transit, most often pull from public feed aggregators like the Mobility Database rather than from each agency directly.

Researchers and regional planning bodies use published GTFS to study service coverage, headways, and equity across a metro area, almost always without contacting the agency that published it.

The Federal Transit Administration, through the National Transit Database, increasingly treats a published GTFS feed as part of what an agency reports. That connection gets its own section below.

A rider at a bus shelter points to the posted schedule while holding a phone

What GTFS Means for a 25-Bus Agency

At a system running 10 to 50 vehicles, GTFS is rarely a technology problem. It is a staffing and cadence problem wearing technology’s clothes.

A 25-bus agency almost never has a dedicated GTFS specialist. The person who owns the feed is usually a planner or a scheduler who learned GTFS from a validator’s error messages. That was on top of a job that never mentioned GTFS. That describes most small agencies, and it is the condition TransitFare was built for. TransitFare is a transit technology company founded in 2012 that builds schedule, fare, and rider information tools for small and mid-sized transit agencies. For 13+ years it has assumed nobody on staff has the time to become a full-time data specialist.

The honest workload looks like this. Building a first feed from an existing schedule, spreadsheet, or older export typically takes a focused week or two. Most of that time goes to stop coordinates and shape files, not the timetable, which the agency already has.

After that, the ongoing work is smaller but never zero. A service change means new calendar dates, a revalidation pass, and a republish to the same URL, usually two to four times a year for most fixed-route systems.

What changes at 25 buses is not the file structure. GTFS is the same six required files whether an agency runs 8 vehicles or 800. What changes is who is available to maintain it and how much slack that person has when a service change lands. It also matters whether the tools involved assume an IT department that does not exist.

Example: one year of feed maintenance Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Spring change Fall change Holidays Renew end_date Every change, the same three steps Edit calendar Revalidate Republish Two weeks early

What Happens When Your Schedule Changes

A schedule change is not a GTFS event by itself. It becomes one the moment the new timetable needs to reach riders before it takes effect, and that is where small agencies lose time they did not budget for.

The mechanics are straightforward. Add the new service pattern to calendar.txt or calendar_dates.txt, update stop_times.txt for any trips that moved, revalidate the whole feed, and republish it at the exact same URL it has always lived at. The part agencies underestimate is timing. Google and Apple do not re-crawl a feed instantly; they check it on their own schedule. A feed republished the same day a change takes effect can leave riders seeing the old timetable for days into the new one. Publishing the update a week or two ahead of the effective date closes that gap.

GTFS and NTD Reporting

The National Transit Database (NTD) is the Federal Transit Administration’s annual reporting system, and it has moved closer to GTFS over recent report years rather than further away. Agencies with fixed-route service are increasingly asked to supply the URL of their published GTFS feed as part of the standard NTD submission, per the FTA’s National Transit Database Policy Manual. GTFS and NTD are no longer two unrelated obligations.

NTD reporting itself is tiered by system size and by the population of the urbanized area an agency serves. Larger systems file a full report; smaller ones can qualify for a shorter reduced report. Where a specific 25-bus agency lands in that tier structure depends on its service area, and the current thresholds are worth confirming directly against the year’s NTD Policy Manual rather than assumed.

What does not vary by tier is the direction of the requirement. A GTFS feed an agency already maintains for Google Maps is fast becoming the same feed it points to for federal reporting. A feed built once and kept current is worth more than its Google Maps visibility alone. An agency that has never published one should treat NTD reporting as a second reason to build it, not a separate project layered on top of Google Maps.

GTFS and Fare Data

GTFS was designed to describe schedules, not to process payments, but it does define fare data. The original Fares v1 structure uses fare_attributes.txt and fare_rules.txt. The newer Fares v2 extension adds a richer set of files that can express zone-based and distance-based pricing. Either way, what GTFS publishes is a description of what a fare costs, not a system that collects it.

The practical risk for a small agency is running two separate definitions of the same fare structure. One lives inside the GTFS feed for trip planners. A different one is configured inside whatever actually charges riders on the bus validator. When those two drift apart, a rider planning a trip in Google Maps sees a price that is not what the farebox charges. If you publish fares in GTFS, update them in the same change as the fare system. TransitFare Automated Fare Collection, which has processed 60 million+ fare validations, keeps the charging side in one place.

What If You Have No GTFS at All?

Start with what already exists. Most agencies that have never published GTFS still have a schedule, whether it lives in scheduling software, a spreadsheet, or a printed timetable. That schedule is the hard part of GTFS. The file structure around it is comparatively mechanical.

The realistic order of operations: get stops and their coordinates into a clean list first, since that is usually the messiest starting point. Build routes and trips from the existing timetable. Validate early and often instead of waiting for a finished feed to surface every error at once. Treat the first publish as a milestone, not a finish line, since every schedule change after it needs the same care. Getting started with GTFS walks through that first build in more detail, and the GTFS starter kit gives header-ready file templates instead of a blank spreadsheet. Agencies that start from zero on TransitFare Cloud typically have a first feed live within about 4 weeks.

The cost of staying at zero is not abstract. Every day without a published feed is a day a rider searching a destination inside an agency’s own service area gets driving directions instead of a bus.

Common GTFS Mistakes

Most GTFS problems at small agencies repeat across the same handful of causes:

  • Stop coordinates that drifted over years of copy-forward edits.
  • An expired calendar.txt end date that quietly removed a whole feed from Google Maps.
  • Past-midnight stop_times recorded as a reset clock instead of GTFS’s 25-hour format.
  • A shape_id never added, so routes draw as straight lines.
  • A feed URL that changed during a website redesign and broke every consumer pointed at the old one. Common GTFS validation errors covers each of these in more depth, with the specific validator messages they produce. None of the five require rebuilding a feed from scratch. Each is a targeted fix once it is found. That is why routine validation before every republish matters more than trying to get a feed perfect once and leaving it alone.

FAQ

Do I Need Special Software to Create a GTFS Feed?

No specific software is required by the standard itself. A valid feed is just correctly structured text files in a zip. In practice, most agencies use their existing scheduling software’s export function or a dedicated GTFS management tool, since building stop_times.txt by hand does not scale past a small pilot route.

How Often Should I Update My GTFS Feed?

Update it whenever service changes, typically two to four times a year for most fixed-route small agencies, and always before the calendar.txt end date lapses. A feed untouched for over a year is very likely stale even if it still technically validates.

What Happens If My GTFS Feed Has Errors?

It depends on the error. A missing required file or field usually causes consumers to reject the entire feed instead of showing a partial system. A warning-level issue, like a stop far from its shape, typically still publishes but degrades what riders see, such as a route line that draws incorrectly.

Is GTFS the Same as a Website Schedule Page?

No. A website schedule page is meant for a person to read. GTFS is meant for software to read. It is what lets Google Maps, Apple Maps, and third-party trip planners show an agency’s routes automatically, so riders do not have to find the agency’s own site first.

Can I Publish GTFS Without a Scheduling Software System?

Yes. GTFS only requires the resulting files to be correctly structured; it does not require any particular source system. Many small agencies build a first feed directly from a spreadsheet timetable, though maintaining it by hand gets harder as the route count grows.

Does GTFS Work for Demand-Response or Paratransit Service?

Fixed-route GTFS does not describe demand-response service well on its own, since there is no fixed timetable to publish. GTFS-Flex was built specifically to close that gap, and an agency running both fixed routes and paratransit typically needs both parts of the standard.

Where This Goes Next

GTFS has no end date: an agency keeps the feed current for as long as it runs service. Every section above connects to a next step: publishing to Google Maps, understanding the three GTFS-Realtime feeds, reporting to NTD, or starting from nothing.

Two failure modes are worth reading before the first submission rather than after: what Google’s feed audit compares your data against, and how a published feed gets dropped again. If either has already happened, GTFS feed recovery covers getting relisted, and a transit schedule widget covers stopping the website drifting from the feed in the first place. Talk to us about your GTFS, or get the GTFS starter kit for file templates before building one from scratch.

Transit Alerts Real-Time Tracking Fare Collection Passenger Counting GTFS publishing NTD data TransitFare Cloud Shared routes and stops