This site lists over 800 castles in Scotland, from past and present, with a zoomable location map and clickable information markers. If you're visiting somewhere in Scotland and want to take in a castle or two, have a look at the map and see what's nearby.
The information in the pop-ups comes from Wikipedia, and includes a link to the castle's wiki page. There are three loose categorisations of castles, shown below with their corresponding map marker:
I hesitated on whether to include the 'No/few remains' castles category, as it seemed nonsensical to have a marker on a map pointing to, well, nothing. In the end, I decided to add them as a historical record but they're switched off by default. To view the 'No remains' category, hover over the legend button at the top right of the map, and tick the box 'No/few remains'. You can show and hide the other map layers here too.
Please be aware that some of the sites shown on the map are privately owned and may not be open to the public, or may only open at certain times. A number of castles are private residences. Each castle's Wikipedia page usually has some information on the ownership/access status. Please check before you visit a site, and respect the privacy of the owners where applicable.