Planning Your Time
One of Edinburgh's greatest virtues is its compact size, which means that it is possible to pack a fair bit into even the briefest of visits. The two main areas of interest are the Old Town and the New Town, where you'll find Edinburgh Castle, the Scottish Parliament, Princes Street Gardens, and the National Gallery of Scotland. You can cover the major attractions in one day, but to give the major sights their due, you should allow two. You can also choose between the Palace of Holyroodhouse and the important museums of Edinburgh, as well as entertaining sights such as the Real Mary King's Close, or explore the Royal Botanic Garden and Holyrood Park. Head down to leafy, village-like Stockbridge, then immerse yourself in the greenery along the Water of Leith, visiting the Gallery of Modern Art along the way.
Getting out of town is also an option for stays of more than a few days, depending on your interests: hop on a bus out to Midlothian to see the magnificent Rosslyn Chapel at Roslin (it's of interest to more than Da Vinci Code fans), and visit Crichton Castle, parts of which date back to the 14th century. Consider spending another half day traveling out to South Queensferry to admire the Forth rail and road bridges; then visit palatial Hopetoun House, with its wealth of portraits and fine furniture.
Don't forget that some attractions have special hours during the Edinburgh International Festival. If you want to see something special, check the hours ahead of time.