Violent crimes are still very rare in Scotland and Edinburgh is generally very safe, in fact it is one of Europe's safest capitals and as a visitor you can feel safe strolling around edinburgh at any time of day or night.
However, as with any city, you should be cautious in areas with which you are unfamiliar. Street crimes do occur, so be streetwise and don't flash your cash, your mobile phone or your jewellery.