Tallinn is the rare capital where the fairy-tale medieval center is real, and where the people who live around it mostly don't make a fuss. The Old Town has been on the UNESCO list since 1997 and still follows its 13th-century plan. The Danes took the hill in 1219, and the castle there was known as taani linn, the Danish castle, a name many link to Tallinn itself. In 1285 the town joined the Hanseatic League and the German merchants below the hill ringed it with walls and 66 defense towers. On 9-10 March 1944 Soviet bombers dropped more than a thousand incendiary bombs, and about a fifth of the city's buildings burned. What you walk through today survived all of that.
The surprise is how fast the story changes once you leave the walls. Ten minutes north is Kalamaja, a district of wooden workers' houses that now has more cafes than workers, and beyond it a Soviet concert hall rotting beautifully by the sea. Tallinn is also where Skype and Bolt were born, and you'll pay for almost everything by tapping a card. Two days gets you the Old Town and a photo from the top of something. Five lets you do Toompea properly, spend a day in the north, go east to the Song Festival Grounds and leave a full day for Lahemaa.
The plan runs from the center outwards. Day one is the Lower Town, day two Toompea and the occupation story, day three Kalamaja and the sea, day four Kadriorg and Pirita, and day five a drive east to the bogs and manors of Lahemaa. Start on a Wednesday: several museums close on Mondays or Tuesdays in the colder months, and this order keeps every one of them open, with Lahemaa on a Sunday when Palmse is open. There's more on the country in our guide to Estonia.