Levoča still has most of its medieval defensive walls — a 2.5 km ring built from the late 14th century onwards in three concentric lines. About 85% of the masonry survives, along with three of the original gates: Košice Gate, Polish Gate, and Menhardt Gate. You can walk most of the perimeter on small streets just inside the walls.
The walls explain why the old town inside them is so compact and well preserved: there was nowhere for the centre to spread, so when Levoča stagnated economically in the 18th and 19th centuries, the old houses simply stayed put rather than being replaced.