Layovers can be frustrating, to say the least. You’re stuck at an airport with nothing to do, surrounded by overpriced food and weary travelers. However, if you plan it right, your layover doesn’t have to be arduous—you might even be able to squeeze some fun out of it.

2 TO 3 HOURS: TREAT YOURSELF

If you only have a couple of hours to kill, you don’t want to venture too far from your gate, but you can probably find something fun to do in your terminal. Airport dining is notoriously expensive, but if you’re going to splurge on airport food, it might as well be good. For suggestions, check out Eater’s Airport Dining Guides, which offer options for every budget in every terminal of many of the country's largest airports.

Aside from dining, most airports boast some unique amenities, many of which are free. For example, Austin’s Bergstrom International Airport has a Music in the Air series that offers free concerts for travelers throughout the airport. And San Francisco International Airport has two 24-hour yoga rooms in Terminal 2 and Terminal 3. XpresSpa is a massage and manicure salon with locations across the country (as well as Dubai and the Netherlands). You can check your own airport’s website to see what specific amenities are available.

Of course, if you prefer to entertain yourself, you can always bring a book or download a movie to your laptop or tablet. Pack some headphones (and a charger) and the time will fly by.

3 TO 4 HOURS: HIDE OUT IN AN AIRPORT LOUNGE

With a bit more time to kill, you might consider getting comfortable in an airport lounge. Most of them include more comfortable seating areas, free WiFi, and free snacks and drinks. Many airline lounges offer day passes, and rates typically start at around $50. United Airlines offers a day pass for $59; Delta has a single-visit pass for the same price (note that capacity restrictions apply).

Many airports have their own public lounges, too, and prices are typically lower. For example, you can stay at JFK’s Airspace Lounge in Terminal 5 for $25, and that includes complimentary tea and coffee, snacks, and access to computers, WiFi, and showers. LoungePass.com can help you find options at your airport.

4 TO 8 HOURS: GET SOME REST

If you have time to catch a few winks, many airports have nearby transit hotels where you can book by the hour. Check out your options on Sleeping in Airports, a database of amenities and hotels near airports around the world. FLIO is a similar airport database tool you can download for iOS and Android.

For a quick nap, some popular hubs have hotel pods or capsules located in their terminals. They’re a lot smaller than traditional hotel rooms, but you can often book them for less than an hour, so you’ll save money. For example:

London: Yotel has pods at Heathrow in Terminal 4 and Gatwick’s South Terminal. Prices range from about $50 for four hours to $100 overnight.

Atlanta: Minute Suites operates five pods in Atlanta on Delta's Concourse B. Their rates start at $42 an hour with a flat overnight rate of $140.

Tokyo: First Cabin Hotel is a capsule hotel in Haneda International Airport’s Terminal 1. Hourly rates start at 800 yen (approximately $8) per hour, with a two-hour minimum.

MORE THAN 8 HOURS: EXPLORE THE CITY

If you have quite a bit of time to kill, it might be worth leaving the airport and exploring the city. Keep your travel info handy, though, in case of any last-minute flight changes.

Many airports have lockers where you can store your luggage while you explore. You can use Sleeping in Airports to run a search by airport to see what kind of facilities are available and how much they cost. You can also use the database to look up information on the airport’s public transportation availability as well as book sightseeing guides for layovers in a number of different cities.

Some airlines have extra-long layovers that can last up to 48 hours. This is a great way to squeeze an extra destination into your trip. Travel site Hopper lists 10 popular airlines that offer free international stopovers. With most flight search engines, you can filter your search by stopovers, then simply look for the flights with the longest stops. Spend a night or two in your connecting city, then head to the airport to continue on your journey.