The best way to ensure that you do not have to stand in long lines outside the Hagia Sophia is to book tickets online. Online ticket bookings are convenient and save time and money. Booking tickets online also ensures that you will get access to the mosque no matter the crowd on the day of your visit.