We develop a new way to measure national subjective well-being across the very long run where traditional survey data on well-being is not available. Our method is based on quantitative analysis of digitized text from millions of books published over the past 200 years, long before the widespread availability of consistent survey data. The method uses psychological valence norms for thousands of words in different languages to compute the relative proportion of positive and negative language for four different nations (the USA, UK, Germany and Italy). We validate our measure against existing survey data from the 1970s onwards (when such data became available) showing that our measure is highly correlated with surveyed life satisfaction. We also validate our measure against historical trends in longevity and GDP (showing a positive relationship) and conflict (showing a negative relationship). Our measure allows a first look at changes in subjective well-being over the past two centuries, for instance highlighting the dramatic fall in well-being during the two World Wars and rise in relation to longevity