Yes, book in advance. The castle says tickets often sell out far ahead, especially in summer. Once they sell out online, no tickets are sold at the castle. Booking online is also cheaper than paying at the gate.
Children under 16 must be with an adult. The castle notes that prices can change.
A standard ticket is the cheapest way in. The Flexi ticket costs more: £38.00 for an adult, £30.50 for a concession and £22.50 for a child. It lets you enter once on any day within seven days of the date you choose, with no timeslot to book. It is worth it if your plans or the weather are uncertain.
Buy only from the official Edinburgh Castle or Historic Environment Scotland websites. The castle warns about lookalike sites selling fake tickets.
Bad weather can close the castle; high winds have shut it at short notice before. If the forecast looks wild, check the website on the morning of your visit.
The castle says to allow at least two hours for the main sights. These include Scotland's Crown Jewels and St Margaret's Chapel, Edinburgh's oldest building, from around 1130. An audio guide costs £4. You can use it on your own phone, but download it before you arrive because signal inside can be patchy.
An early slot gives you the most time before last entry, which matters most in winter. If you can be inside at 1pm, you will hear the One O'Clock Gun. It is fired every day at 1pm except Sundays, Good Friday and Christmas Day.
The constantXplorer Edinburgh 3-day guide plans the castle around an early slot, then takes you down the Royal Mile, with a wet-weather backup if the castle closes.
The constantXplorer Edinburgh 3-day guide plans the days around this, with the tickets decided, the routes connected and the way back to your hotel. Printable, and offline on your phone. $12.