The study, conducted by anti-bullying charity Ditch the Label and social media monitoring company Brandwatch, analysed 19 million tweets from the US and the UK. Researchers worked out the proportion of hateful tweets to ones considered constructive or neutral.
They used this information as the basis for a “hate speech ratio” for every council area in the UK.
Midlothian’s score for racist tweets was 53.85, meaning more than half of all tweets in the area relate to race relations were hateful.
Edinburgh meanwhile produced some of the most tolerant tweeters in Scotland. Glasgow had a hate speech ratio of 3.00 with regards to homophobia, whilst Edinburgh’s score was only slightly worse at 3.59. Speaking about the study, Edward Crook, Research Manager at Brandwatch, said: “The data paints a troubling view of online abuse, but we should remember that social networks are also a powerful source of support for those experiencing bullying.”