Think about your five closest friends. What do they care about? Do they love the gym? Long walks on the beach? Maybe they smoke, or are overweight. You should choose your friends wisely, because they can have a big influence on your health.

Growing evidence suggests disease spreads through social networks. According to a US study which followed 12,000 people for 32 years, if you have a close friend who becomes obese, your chances of becoming obese increase by 171%. And your risk of attempting suicide is four times higher if you have a friend who has tried to kill themselves.

So, if social networks can make you sick, can they also make you healthier? It seems they can, but in one of life’s annoying asymmetries, the health effect doesn’t seem to be as strong as the illness effect.

Recent studies have shown that quitting smoking spreads through social networks. If your significant other quits you have a 67% decreased chance of smoking.

And research confirms what we have always suspected – happiness is contagious. Your chances of becoming happier increase if you are surrounded by happy people.

The strength of the contagion depends on how close you live, and your relationship with the happy person. The strongest effect occurs if you have a happy friend who lives within 1.6km of you (25% increased chance of becoming happy).

Happy siblings or spouses can also help, but less so, increasing your chances of becoming happy by 14% and 8% respectively. Happy co-workers has no effect at all, so it’s OK to be grumpy at work.

Is health really contagious?

But couldn’t all this be due to like people attracting like? Scientists have tested this. It seems the effect really is due to the behaviours spreading over time, from key central “nodes” to their social connections. The spread can be seen up to three degrees of separation, so you can actually influence the friends of your friends’ friends.

The “direction” of the connection is also important. The study examining obesity’s spread through social networks found that if you consider someone your friend and they became obese, your chances of becoming obese increase modestly (57% increased risk).

Yet if they consider you a friend but the feeling isn’t mutual, your risk of obesity is unaffected. Worst of all, if you consider each other as friends and your friend becomes obese, your chances of becoming obese nearly trebles (171% increased risk). But we’re not suggesting that you unfriend your overweight friends as a preventative measure.

As this contagion effect of health has become recognised, researchers have tried to exploit it to improve health. In a 2015 study, public health scientists delivered a multivitamin supplement program in rural villages in Honduras.

The program was spread using word of mouth, starting with 5% of village residents. In some villages they randomly selected the initial targets, and in other villages they randomly selected individuals, asked them to name a friend, and then these nominated friends became the initial targets.

Uptake of the multivitamins was significantly higher in the villages where the initial targets were the nominated friends. This exploits the “friendship paradox”, that on average, your friends have more friends than you do.

What about online social networks?

Online social networks also present a ripe opportunity to deliver health programs. Our recent review identified burgeoning scientific interest in this idea, with promising results. Our study of a gamified Facebook app which helps users team up with online friends to compete in a 50-day physical activity challenge led to a two-hours-per-week increase in physical activity.

Other programs have targeted a wide range of health behaviours, including weight loss, exercise, quitting smoking and sexual practices.

Using online social networks to improve your health isn’t for everyone. Sharing health information online can be confronting. But, on the upside, social networks provide public accountability, opportunities for social support, and friendly rivalry – all powerful motivational tools.

If you are interested in trying an online social networking exercise intervention, join our new study and recommend a friend.