(WHDH) — With summer just a couple of months away, many people are planning out their vacations.

One of the major headaches associated with this is the cost of flights. CheapAir.com analyzed 917,000,000 airfares in more than 8,000 markets to find the cheapest times for consumers to book their flights.

The prime booking window for cheap airfare is three weeks to four months before the flight departs, according to CheapAir.com’s 2018 Annual Airfare Study. Booking before the four-month mark could result in an increase of $20 to $50 per ticket. Those who wait six days before the flight to the day of will pay on average of $208 more for their ticket.

When it comes to summertime flights, the best time to buy is about 1.5 months in advance, the study found.

Tuesday and Wednesday proved to be the cheapest days to fly, with Sunday being the most expensive. Flying on Wednesday instead of Sunday could save a consumer $76 per ticket, the study added.

(Copyright (c) 2022 Sunbeam Television. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox