Facebook users are unwittingly revealing intimate secrets – including their sexual orientation, drug use and political beliefs – using only public "like" updates, according to a study of online privacy.

The research into 58,000 Facebook users in the US found that sensitive personal characteristics about people can be accurately inferred from information in the public domain.

Researchers were able to accurately infer a Facebook user's race, IQ, sexuality, substance use, personality or political views using only a record of the subjects and items they had "liked" on Facebook – even if users had chosen not to reveal that information.

The study will reopen the debate about privacy in the digital age and raise fresh concerns about what information people share online.

Michal Kosinski, one of the academics behind the study, said he believed Facebook users would be "spooked" by the findings and called for regulatory intervention by politicians.

"The important point is that, on one hand, it is good that people's behaviour is predictable because it means Facebook can suggest very good stories on your news feed," said Kosinski, the lead Cambridge University analyst who worked with Microsoft Research on the study, published in the Proceedings of the National Academy of Sciences (PNAS) journal.

"But what is shocking is that you can use the same data to predict your political views or your sexual orientation. This is something most people don't realise you can do."

He warned that certain information – such as sexuality or religious views – could pose threats to internet users' safety if it got into the wrong hands. "Everyone carries around their Facebook 'likes', their browsing history and their search history, trusting corporations that it will be used to predict their movies or music tastes," Kosinski said.

"But if you ask about governments, I am not sure people would like them to predict things like religion or sexuality, especially in less peaceful or illiberal countries."

The researchers used computer software to predict personality traits, but said the same information could be collected by anyone with training in data analysis. They were able to draw "surprisingly accurate" findings about people by aggregating swaths of seemingly innocuous "likes", such as TV shows and movies.

They said they were able to predict whether men were homosexual with 88% accuracy by their likes of Facebook pages such as "Human Rights Campaign" and "Wicked the Musical" – even if those users had not explicitly shared their sexuality on the site. Fewer than 5% of the homosexual participants in the study clicked obvious Likes, such as "Gay Marriage", researchers said.

Computer software inferred with 88% accuracy whether a male Facebook user was homosexual or heterosexual – even if that person chose not to explicitly reveal that information. It had a 75% accuracy rate for predicting drug use among Facebook users, analysing only public "like" updates. The findings will reignite concerns over how much private companies and governments know about internet users through their online habits.

"I hope internet users will change their ways and choose products and services that respect their privacy," said Kosinski. "Companies like Microsoft and Facebook depend on users willing to use their service – but this is limited when it comes to Facebook because 1 billion people use it."

Online sites such as Facebook should be forced by regulation to inform users that deeply private information may be gleaned about them using the same technology that recommends films and music, he added.

The findings come shortly after Facebook announced a partnership with four of the world's biggest data brokers aimed at improving targeted advertising on the site. The move means Facebook can target ads to its users based on their online and offline activity, including their location and high street shopping habits.

Facebook declined to comment.

Personality trait and predictive Likes, according to the study

High IQ

The Godfather

Lord of the Rings

The Daily Show

Low IQ

Harley Davidson

I Love Being A Mom

Tyler Perry

Emotional stability – neurotic

Emo

Dot Dot Curve

So So Happy

Emotional stability – calm and relaxed

Business administration

Climbing

Getting Money

Homosexual males

Wicked the Musical

No H8 Campaign

Human Rights Campaign

Homosexual Females

Not Being Pregnant

The L Word

Sometimes I Just Lay In Bed and Think About Life

Parents separated at 21

I'm Sorry I Love You

Never Apologize For What You Feel

It's Like Saying Sorry For Being Real

When Ur Single, All U See Is Happy Couples N Wen Ur In A Relationship All U See Is Happy Singles

Parents did not separate at 21

Apples To Apples: The Helen Keller Card

Gene Wilder

Making Dirty Innuendos Out Of Perfectly Innocent Things