There’s no two ways about it: Holiday travel is stressful and expensive.

A last-minute jaunt can cost you hundreds more in airfare if you don’t plan ahead. It is the busiest time of year for airports, as millions of Americans shuttle across the country visiting friends and loved ones.

Holiday travel 2017 doesn’t have to be expensive if you follow these hacker pro-tips.
Although no quantity of data can save you from long lines at airports and weather-related cancellations that seemingly plague the season, KAYAK is out with their annual holiday travel hacker tips that will save you the headache of guessing the best time to book holiday airfare. They crunched billions of searches to predict the best times, and places, for you to spend the annual celebrations.

Cut it close for Thanksgiving

Your parents might not like this, but median airfare dips to a cool $362 two weeks ahead of turkey day. The priciest flights are three months out.

If your plans are flexible or you are skipping the holiday altogether, consider waiting until the last minute to book your Thanksgiving flights to save money.

And if possible, avoid flying on Friday, November 17; Wednesday, November 22; and Sunday, November 26 as Google Flights predicts those will be the busiest days to fly this Thanksgiving.

Six weeks for Chanukah, Christmas and Kwanza

Traditionally, a month before a trip is the worst time to buy airfare. But for the busy holiday season, the four-to-six week window offers the best airfare, with an average median flight cost of $276.

“KAYAK data shows that you can score a great deal if you fly in and out on Christmas or Christmas Eve, but of course, many people don’t want to do that,” said Dave Solomito, Vice President of North America Marketing for KAYAK, in an email. “Not to worry – our data shows that you can still score a reasonable deal by departing on 12.23 and returning on 12.26 – expect to see round trip median airfare hovering slightly over $400.”

Early birds don’t get the worm in this equation, with the highest median price clocking in at $360, nearly three months out from the holidays.

High and dry for 2018

Book New Year’s Eve flights whenever it makes the most sense for you. The holiday seems to have the least fluctuation in prices, with the lowest median airfare available two weeks out at $422. The highest median airfare is a measly $32 more ($455), if you book three months in advance.

“If you’re ringing in 2018 away from home, consider flying out on New Year’s Eve to nab a good deal,” recommends Solimito. “While travel on the holiday isn’t ideal, the good news is that if you do, you have some flexibility on the date you return home – historic data shows that the difference between flying home the first three days of January is less than $15.”

Consider Guadalajara, Mexico, KAYAK’s top trending New Year’s destination for 2018. Other exotic locales to welcome in 2018 include Kingston, Jamaica, and Mexico City, Mexico.

Alexandra Talty, CONTRIBUTOR, FORBES MAGAZINE