To safely leave the airport during a layover and return in time for your next flight, you generally need a minimum of 5 to 6 hours for domestic connections and at least 8 to 10 hours for international connections. This time is necessary because the "layover" clock starts the moment you land, but it takes 30–60 minutes to deplane and exit the terminal. For international trips, you must also factor in 1–2 hours for immigration and customs both when leaving and re-entering. Travel time to the city center and back can take another 1–2 hours depending on the city's infrastructure (for example, Zurich is very close to its airport, while Tokyo Narita is very far). Crucially, you must be back at the airport at least 2 hours before a domestic flight and 3 hours before an international flight to clear security again. If your layover is only 3 or 4 hours, you will likely spend more time in transit than actually seeing anything, making it much safer to stay within the terminal. Always check if a transit visa is required before exiting in a foreign country to avoid legal complications.