Yes, entry to Hagia Sophia is free. In July 2020, the Turkish government converted the building from a museum back into an active mosque (the Hagia Sophia Grand Mosque), and since then there has been no admission fee. This is a significant change from the museum era, when tickets cost a substantial amount. You can now walk in without a ticket during visiting hours, which generally run from early morning until evening, with closures during the five daily prayer times. Friday midday prayers cause a longer closure, typically from around 11:30 AM to 1:30 PM or later.
Because it functions as a mosque, there is a dress code you must follow. Both men and women should cover their knees and shoulders. Women are required to cover their hair with a headscarf. Do not worry if you forget — free headscarves and wraps are available at the entrance. Shoes must be removed before entering; plastic bags are provided to carry them. The floor is carpeted throughout. These rules apply to everyone regardless of religion.
The best time to visit and avoid the worst crowds is early morning, right when it opens (usually around 9:00 AM for tourists, though worshippers can enter earlier). Weekday mornings are significantly less crowded than weekends. During peak tourist season (June through September) and around Turkish public holidays, expect long queues and packed interiors regardless of when you go. The late afternoon slot between the last two prayer times can also be relatively calm. Check the daily prayer schedule before you head over so you do not arrive during a closure.
Photography is generally allowed inside Hagia Sophia, but there are important caveats. You should not photograph people who are praying, and you may be asked to stop taking photos during active prayer times. Video recording is usually fine as well, with the same restrictions. The interior is dimly lit in many areas, so a phone with good low-light performance helps. The massive dome, the Byzantine mosaics (some are still partially visible), the mihrab, and the enormous calligraphic medallions are the main visual highlights.
The location could not be more convenient for sightseeing. The Blue Mosque (Sultan Ahmed Mosque) sits directly across the park from Hagia Sophia, and the Basilica Cistern is just a few minutes’ walk away. You can easily visit all three in a single morning. The Topkapi Palace entrance is also within a 5-minute walk. If you want to understand the layered history of this extraordinary building — from Byzantine cathedral (537 AD) to Ottoman mosque to secular museum to mosque again — consider picking up an audio guide or reading up beforehand, since there are no museum-style information panels inside anymore.
Arriving with some historical context will make the visit far more meaningful. This building has stood for nearly 1,500 years and was the largest cathedral in the world for almost a millennium. The engineering of the dome, the remnants of Christian mosaics coexisting with Islamic calligraphy, and the sheer scale of the interior are genuinely awe-inspiring, whether you have a particular interest in history or not.