Gay men can be outed by looking at their Facebook friends, a study has found.

According to researchers, the information can be found despite discretion and privacy settings.

Although many people set their profiles to private, they usually do not hide their friend lists and researchers say it is their friends’ profiles which can reveal personal data such as sexuality.

The small study was carried out by students Carter Jernigan and Behram Mistree from Massachusetts Institute of Technology.

They developed software which looked at the gender and sexuality of a person’s Facebook friends. It then used statistical analysis to make a prediction of someone’s sexuality.

Although Jernigan and Mistree could not ascertain the sexuality of all the men they surveyed, the programme gave 100 per cent correct results for a small control group.

However, it did not work on lesbians or bisexual people of either gender.

The study has not been published in any academic journal but has raised interesting questions about privacy and discretion on the web.

Kevin Bankston, an attorney for the Electronic Frontier Foundation, a San Francisco nonprofit digital rights group, told the Boston Globe: “Even if you don’t affirmatively post revealing information, simply publishing your friends’ list may reveal sensitive information about you, or it may lead people to make assumptions about you that are incorrect.

“Certainly if most or many of your friends are of a particular religious or political or sexual category, others may conclude you are part of the same category – even if you haven’t said so yourself.”