Two separate tickets, two separate queues, one small square
The Doge's Palace and St Mark's Basilica in one day
They stand next to each other and most visitors want both, but they are entirely separate operations with separate tickets and separate queues. Sequencing them properly is the difference between a good day and four hours of standing.
Book your Doge's Palace entry ↗They are not connected
The first thing to understand: your Doge's Palace ticket does not admit you to St Mark's Basilica, and a basilica ticket does not admit you to the palace. They are run by different bodies, they queue separately, and they book separately. Plan them as two distinct visits that happen to be forty metres apart.
The right order
Palace first thing, basilica afterwards. The palace rewards an early start more, because its route is long and gets progressively more congested through the morning. The basilica's own timed entry can then be booked for late morning or early afternoon.
Book both in advance
Both now operate on reserved entry and both are considerably worse without it. St Mark's in particular has a reputation for very long queues in high season, and its reserved-entry option is inexpensive relative to the time it saves.
A realistic timetable
Nine o'clock at the palace, out by half past eleven. Coffee somewhere off the square. Basilica around midday for an hour, including the Pala d'Oro and the loggia with the bronze horses, which is worth the small extra charge for the view over the square. Lunch away from San Marco. Correr and the Marciana Library in the mid-afternoon on your palace ticket if you still have the appetite.
The dress code
This catches people out. St Mark's is a working church and enforces a dress code — shoulders and knees covered — and will turn people away at the door. The palace has no such rule. If you are doing both on a hot day, dress for the basilica and carry something light rather than assuming you can improvise.
The Campanile
The bell tower is a third separate ticket. It has a lift and gives the best overhead view of the square and the domes of the basilica. Worth doing if the queue is short, easy to skip if it is not — and unlike the palace and the basilica, it is genuinely a fine-weather activity.
Where to eat
Not on the square. The restaurants facing Piazza San Marco charge for the position and it is not a good trade. Walk five minutes in almost any direction and both the food and the price improve sharply.
If you only have time for one
The basilica is the more extraordinary object — the mosaics are unlike anything else in western Europe — and it takes an hour rather than three. The palace is the more interesting visit, because it explains how the city worked. For a single short stop, the basilica; for an afternoon, the palace.