Air travel is enough of a hassle, and the last thing any traveler wants is to pay more for a flight than necessary.

“(There's) nothing worse than checking (fares) two days later and seeing you could have gotten it for $50 cheaper,” said Steve Lippincott, an airline traveler.

A study by CheapAir.com, an online booking site, aims to take some of the guesswork out of booking flights. Cheap Air analyzed more than 4 million flights to figure out when you get the best deal.

The study found 54 days before a flight is the magic number. That’s about 7 1/2 weeks before your departure date.

If you miss that window, the CheapAir.com report shows, another prime time is between one to 3 1/2 months before. Book within that window and ticket prices typically hover within $10 of the lowest they’ll ever reach.

Experts say don’t wait until the last minute. Generally, delaying will mean higher ticket costs. Prices start to go up about two weeks before a flight, increasing each day right up to the day before, the absolute worst time to book.

And for the always popular winter holiday season, CheapAir.com recommends booking five months before Thanksgiving and six months before Christmas.

Other tips:

  • Booking international flights varies by destination, but you should book most trips abroad at least 100 days in advance for the best deal.
  • If you’re going somewhere very popular at a very popular time, such as spring break in Florida, you should book well before the prime booking window. That's because airlines have no incentive to drop the fares as time goes on.