Planning a vacation can be tricky, not least because the prices of flights change constantly. Everyone has a different rule of thumb as to how far in advance to buy tickets, but it's definitely not a science. If you're hoping to get away sometime in 2019, though, the experts at Kayak have your back.

Kayak's 2019 Travel Hacker Guide is an online cheat sheet designed to help you figure out where to go in the upcoming year based on price, location, and the type of vacation you're interested in. Its most useful feature is the "When to Fly" section, which surfaces the best domestic and international travel deals organized by month. In January, for instance, there's still time to head to Osaka, Japan or Tampa, Florida, both of which have great discounts on flights right now. If you're still saving up your vacation days, May is a better time to head to Hawaii or Reykjavik. If you can wait until September, Cozumel, Mexico is the place to go on a discount flight.

When it comes to buying flights, how far ahead you want to book might depend on the region you're flying to. According to Kayak, if you're flying from the U.S. to somewhere else in North America or to the Caribbean, you should book a month in advance, while U.S. residents flying to Europe, the Middle East, or Asia should book six months out. Flights from the U.S. to Central America should ideally be booked three months before takeoff, while flights to the South Pacific should be booked four months ahead of time. Flights to Africa should be booked five months beforehand.

Expedia has previously recommended booking flights a minimum of 21 days in advance, and ideally booking the trip on a Sunday. Skyscanner, meanwhile, has reported that flights for the upcoming year tend to be cheapest within the first two weeks of January, so get planning. And if you end up regretting your purchase, be sure to check out our guide to getting your money back when switching flights.

Check out the rest of Kayak's travel-planning guide here.