Information about sexuality can be revealed from the things you choose to ‘like’ on Facebook, a study suggests.

Researchers at Cambridge University used algorithms to predict religion, politics, race and sexual orientation.

The study used 58,000 volunteers who alongside their Facebook ‘likes’ and demographic information also provided psychometric testing results – designed to highlight personality traits.

The algorithms proved 88% accurate for determining male sexuality, 95% accurate in distinguishing African Americans from Caucasian Americans and 85% for differentiating Republicans from Democrats.

The links clicked rarely explicitly revealed these attributes. Fewer than 5% of gay users clicked obvious ‘likes’ such as PinkNews, for instance.

Instead, the algorithms aggregated huge amounts of ‘likes’ such as music and TV shows to create personal profiles.

“I appreciate automated book recommendations, or Facebook selecting the most relevant stories for my newsfeed. However, I can imagine situations in which the same data and technology is used to predict political views or sexual orientation, posing threats to freedom or even life,” said Michael Kosinski, lead researcher on the project.

“This research should ring alarm bells for anyone who thinks that privacy settings are the solution to protecting information online. We need to fundamentally re-think how much data we are voluntarily sharing,” said Nick Pickles, director of privacy campaign group Big Brother Watch.

“Sharing individual ‘likes’ or pages might not seem hugely intrusive, but it allows individuals to be categorised and behaviour predicted in areas that are far more personal and sensitive than people realise.