Values such as care, compassion and safety are more important to us now than they were in the 1980s. The importance of respecting authority has fallen since the beginning of the 20th century, while judging right and wrong based on loyalty to country and family has steadily risen.

Our analysis, using the Google Books database and published in Plos One, showed distinctive trends in our moral priorities between 1900 to 2007.

How we should understand these changes in moral sensibility is a fascinating problem. Morality is not rigid or monolithic. Moral Foundations Theory, for instance, puts forward five moral grammars, each with its own set of associated virtues and vices.

These are:

purity-based morality, which is rooted in ideas of sanctity and piety. When standards of purity are violated, the reaction is disgust, and violators are seen as unclean and tarnished

authority-based morality, which prizes duty, deference, and social order. It abhors those who show disrespect and disobedience

fairness-based morality, which stands in opposition to authority-based morality. It judges right and wrong using values of equality, impartiality and tolerance, and disdains bias and prejudice

ingroup-based morality, which esteems loyalty to family, community or nation, and judges those who threaten or undermine them as immoral

harm-based morality, which values care, compassion and safety, and views wrongness in terms of suffering, mistreatment and cruelty.

People of different ages, genders, personalities, and political beliefs employ these moralities to different degrees. People on the political right, for instance, are more likely to endorse the moralities of purity, authority and ingroup loyalty. Those on the left rely more on the morality of harm and fairness. Women tend to endorse harm-based morality more than men.

We used these five moral foundations in our analysis. Put simply, our culture, at least as revealed through moral language in the books we read and write, is increasing the emphasis it places on some moral foundations and decreasing its emphasis on others.

Read more: The greatest moral challenge of our time? It's how we think about morality itself

Historical change in moral concepts

Moral psychologists know a lot about how people today vary in their moral thinking, but they have largely ignored how moral thinking has changed historically. As cultures evolve and societies develop, people’s ways of thinking about good and evil also transform. The nature of that transformation is a matter of speculation.

One narrative suggests our recent history is one of de-moralisation. On this view, our societies have become progressively less prudish and judgmental. We have become more accepting of others, rational, irreligious, and scientific in how we approach matters of right and wrong.

A contrary narrative implies re-moralisation. By this account, our culture is increasingly censorious. More things offend and outrage us, and the growing polarisation of political debate reveals excesses of righteousness and self-righteousness.

We wanted to find which of these stories best captured how morals have changed over time, and we used an emerging field of inquiry to do so – culturomics. Culturomics uses very large text databases to track changes in cultural beliefs and values. Changing patterns of language use over time may reveal alterations in how people have made sense of their world and themselves.

The most common platform for examining such cultural shifts is the Google Books database. Containing more than 500 billion words from 5 million scanned and digitised books, the database is a rich source of information on the rising and falling popularity of words.

Studies using English-language books, for example, have shown increases in individualist values, revealed through decreases in “us” and increases in “me”. Studies in Chinese-language books have shown similar declines in words associated with collectivist values in recent decades.

Read more: Google's vast library reveals the rising tide of climate-related words in literature

To date, there has only been one culturomic study of moral language. The researchers examined changes in the frequency of a set of virtue words such as “conscience”, “honesty” and “kindness” over the 20th century. As the de-moralisation narrative would predict, most of these words showed a significant decline in popularity, suggesting ideas of moral virtue became less culturally salient.

In our study, we explored changes in 20th century morality in greater depth. Each of the five foundations was represented by large, well-validated sets of virtue and vice words. We also examined changes in a set of basic moral terms such as “good”, “moral”, “righteous”; and “bad”, “evil”, and “wrong”.

We extracted the relative frequency of each word in a set for every year, standardised it so that the year in which this frequency peaked scored 100, and then averaged the words in the set. The trajectory of these averaged values over time reflects broad changes in the prominence of each form of morality.

Differently moral

We found basic moral terms (see the black line below) became dramatically scarcer in English-language books as the 20th century unfolded – which fits the de-moralisation narrative. But an equally dramatic rebound began in about 1980, implying a striking re-moralisation.

The five moral foundations, on the other hand, show a vastly changing trajectory. The purity foundation (green line) shows the same plunge and rebound as the basic moral terms. Ideas of sacredness, piety and purity, and of sin, desecration and indecency, fell until about 1980, and rose afterwards.

The other moralities show very different pathways. Perhaps surprisingly, the egalitarian morality of fairness (blue) showed no consistent rise or fall.

In contrast, the hierarchy-based morality of authority (grey) underwent a gentle decline for the first half of the century. It then sharply rose as the gathering crisis of authority shook the Western world in the late 1960s. This morality of obedience and conformity, insubordination and rebellion, then receded equally sharply through the 1970s.

Ingroup morality (orange), reflected in the communal language of loyalty and unity, insiders and outsiders, displays the clearest upward trend through the 20th century. Discernible bumps around the two world wars point to passing elevations in the “us and them” morality of threatened communities.

Finally, harm-based morality (red) presents a complex but intriguing trend. Its prominence falls from 1900 to the 1970s, interrupted by similar wartime bumps when themes of suffering and destruction became understandably urgent. But harm rises steeply from about 1980 in the absence of a single dominating global conflict.

What can we say about this?

The decades since 1980 can be seen as a period when moral concerns experienced a revival. What has driven this revival is open to speculation. Some might see the election of conservative governments in the US, UK and Australia at the start of this period as a pivotal change.

That might explain the rise of the typically conservative purity-based morality but not the even steeper increase in the typically liberal harm foundation.

Others might point to the rise of social justice concerns – or “political correctness” to critics – as the basis for the upswing in harm-based morality. The surge of harm language during early- and mid-century wartime may point to the late century rise being linked to the so called “culture wars”. Certainly, the simultaneous rise in conservative (purity) and left-liberal (harm) moralities since that time is a recipe for moral conflict and polarisation.

Read more: How we decide who and what we care about – and whether robots stand a chance

Our research has its limitations. Books are windows into only some aspects of culture. The population of English-language books is dominated by American and to a lesser extent British volumes, and we cannot isolate patterns specific to different English-speaking nations. The Google Books database does not allow us to examine changes in morality over the past decade.

Even so, this research points to some important cultural transformations. How we tend to think about matters of right and wrong is different now from how we once did and, if the trends are to be believed, how we will in the future.