Edinburgh works at any time of year, but two windows define the calendar: August and Hogmanay. Outside those, the city is much quieter and accommodation is much cheaper. The weather is famously unreliable — even July rarely manages two warm days in a row — so come prepared for sun, rain and a stiff easterly all in the same afternoon.
August: the Festivals. For three weeks in August, Edinburgh more than doubles in size. The Edinburgh International Festival (high-end opera, theatre, dance, classical music) and the much larger Edinburgh Festival Fringe (3,000-plus shows in every venue with a roof) run together with the International Book Festival, the Art Festival and the world-famous Royal Edinburgh Military Tattoo at the castle. The city is electric, but accommodation is brutally expensive and you must book months ahead. The Edinburgh International Film Festival runs separately, usually in mid- to late August.
Hogmanay (New Year). The three-day Hogmanay celebrations bring a torchlight procession, a vast street party along Princes Street and a fireworks display from the castle that draws hundreds of thousands. Tickets for the main events sell out long in advance. Bring serious cold-weather clothes — early January in Edinburgh is properly cold.
Spring and autumn. April-May and September-October are arguably the best months. Long daylight hours either side of summer, the city's parks and gardens at their best, lower prices, and the Old Town not yet (or no longer) wall-to-wall with festival traffic.
Winter. Cold, dark and often wet, but the pubs are at their cosiest, the Christmas market in Princes Street Gardens runs through December, and the city has a brooding, atmospheric feel that suits it.