Looking to save money on a flight? Your best bet is to book your flights 21 days before departure, according to a new study by the travel booking website Kayak.

Over a six-month period before departure, the average fare for a domestic flight is $370, according to a study of millions of flights booked by Kayak users. But that fare drops to its lowest level — $342 — when booked 21 days before departure, according to Kayak.

For international flights, the lowest fare can be booked 34 days before departure, when the average price is $977, compared with $1,016 for the six-month period before takeoff, the study said.

Other tips: If you’re taking a quick domestic trip, you can save as much as 16 percent on an airfare by departing on a Saturday and returning Monday. For trips more a week long, you can save as much as 10 percent by leaving on a Tuesday and returning on a Wednesday.

For quick international flights, you can save 21 percent if you leave on a Tuesday and return the following Wednesday. For international trips longer than a week, you can save 9 percent if you leave on a Saturday and return on a Sunday.

(c)2012 Los Angeles Times. Distributed by MCT Information Services.