A traveler walks through Terminal 3 at O’Hare International Airport in Chicago. Airfare is up 10.7 percent in the past five years — after adjusting for inflation — according to an Associated Press analysis of data from the Airlines Reporting Corp.

NEW YORK — Travelers, prepare to pay more for your flight.

The average roundtrip ticket within the U.S., including taxes, reached $509.15 in the first six months of this year, up nearly $14 from the same period last year. Domestic airfare continues to outpace inflation, rising 2.7 percent compared to the 2.1 percent gain in the Consumer Price Index.

Airfare has gone up 10.7 percent in the past five years — after adjusting for inflation — according to an Associated Press analysis of data from the Airlines Reporting Corp., which processes ticket transactions for airlines and more than 9,400 travel agencies, including websites such as Expedia and Orbitz.

The formula for rising fares seems simple, but it eluded the airlines for years: Match the supply of seats to passenger demand.

“Airlines have reduced the number of seats while more people want to fly because of the economic recovery. All this leads to higher airfares,” says Chuck Thackston, managing director of data and analytics at Airlines Reporting Corp. “This trend in airfares is likely to continue for the near future, as the economy continues to grow.”

These days, fares only capture part of the cost of flying. Many passengers pay extra to check their luggage, typically $50 roundtrip for the first bag and $70 for the second one. But bag fees haven’t changed much in the past few years. Now, the airlines are increasingly enticing passengers to pay for fast-track security lines, early boarding, additional legroom and other extras that can add from $9 to $299 to the cost of a flight.

So, for example, a $300 ticket can balloon to $450 on some airlines if you check two bags and pay $30 for a little more room to stretch your legs.

And travelers aren’t finding much relief after landing. The average nightly price of a hotel room in the U.S. during the first half of this year was $113.80, according travel research company STR. That’s up $4.47, or 4 percent, from the same period in 2013.

Most people are traveling for work. And when the economy is strong, they do more flying. Data released by the government last week shows that economic growth bounced back after a brutal winter, businesses are creating jobs at a steady pace and consumer spending is on the rise.

The Global Business Travel Association predicts that worldwide business travel will grow 6.9 percent this year to a record $1.18 trillion. The United States is the business largest travel market, with travelers spending $274 billion last year, a 4.5-percent increase over 2012.

Baggage fees and some others were introduced in 2008 to offset losses from rising fuel prices. However, this year airlines are actually paying less for fuel — $2.96 a gallon so far, 7.2 percent less than last year, when adjusted for inflation.

Passengers aren’t seeing any of those savings. One reason is that airlines no longer need to entice fliers with lower fares. There are simply fewer choices today.

A wave of consolidation that started in 2008 has left four U.S. airlines — American Airlines, Delta Air Lines, Southwest Airlines and United Airlines — controlling more than 80 percent of the domestic air-travel market. Discount airlines such as Allegiant Air and Spirit Airlines have grown at breakneck speed but still carry a tiny fraction of overall passengers.