The happiest teens spend just under an hour a day on social and other digital media, a new study suggests.

Analysis of more than a million children aged 13 to 18 found that unhappiness began to increase after more than an hour of screen time, while those participating in traditional activities such as sports and time with friends were the most content.

However, the researchers at San Diego State University advised against avoiding digital media completely, as this was also associated with unhappiness.

The survey asked students questions about how often they spent time on their phones, tablets and computers, as well as questions about their in-the-flesh social interactions and their overall happiness.

Teens whose eyes were habitually glued to their smartphones are markedly unhappier, and the research team believes screen time drove the unhappiness, rather than visa versa.

"The key to digital media use and happiness is limited use," said Professor Jean Twenge, who led the research.

"Aim to spend no more than two hours a day on digital media, and try to increase the amount of time you spend seeing friends face-to-face and exercising, two activities reliably linked to greater happiness."

Looking at historical trends from the same age groups since the 1990s, the researchers found that the proliferation of screen devices over time coincided with a general drop-off in reported happiness.