Ever wondered whether people were happier in the past? We now have a much better idea, thanks to a new technique that involves analyzing the sentiment behind the words used in millions of pieces of text over the last 200 years. (And the answer is: people in the US are probably happier now than they’ve ever been, despite what you might think.)

The study: A team of researchers, led by Thomas Hills at the University of Warwick, analyzed 8 million books and 65 million newspaper articles published between 1820 and 2009. They assigned happiness scores to thousands of words in different languages and then calculated the relative proportion of positive and negative language for the four different countries.

These scores were used to create historical happiness indices for the UK, the US, Germany, and Italy. The researchers took into account the fact that certain words change their meaning over time (gay, for example). The collection was drawn from Google Books, and it represents a digitized record of more than 6% of all books ever published. The method was validated by comparing the findings with survey data on well-being from the 1970s, collected through about 1,000 face-to-face interviews each year in every European Union country (the Eurobarometer). Their study is published in Nature Human Behavior today.

The findings: There is an awful lot of data to work through, and the findings probably won’t be hugely surprising to anyone with a decent grasp of world history (both world wars made people generally very unhappy, for example). The low point of happiness in the US was around the time of the Fall of Saigon in 1975, while for the UK it was the Winter of Discontent of 1978-79, when there were widespread public sector strikes.

The big picture: New ways to measure well-being and happiness could help to inform national policies. The UK’s statistics authority, for example, has been measuring levels of national well-being since 2010. And this year New Zealand included national well-being as an official metric in its economic planning. Using written material to provide historical context could prove invaluable to the fledgling discipline.

Sign up here for our daily newsletter The Download to get your dose of the latest must-read news from the world of emerging tech.