BY THE age of six, John Stuart Mill had written a history of Rome. By seven, he was devouring Plato in Greek. “This looks like bragging,” his father James told a friend when the boy was eight; “John is now an adept in the first six books of Euclid and in Algebra.”

The hot-housing that began at the younger Mill’s birth in 1806 yielded its intended result: a prodigy with a profound faith in the power of reason. He became the leading exponent of the philosophy of liberalism, formulating ideas about economics and democracy that shaped the political debates of the 19th century. His reflections on individual rights and mob rule still resonate today. Especially today.

Mill grew up at a time of revolution. Democracy was on the march. America had broken free from Britain; France had overthrown its monarchy. In 1832 Britain passed the first Reform Act, which extended the franchise to the middle classes. The Industrial Revolution was in full swing. The old social order, in which birth determined social position, was disintegrating. Nobody could be certain what would replace it.

Many today see Mill as an avatar for the ruthless capitalism of his era. Henry Adams, an American historian, referred to Mill as “his Satanic free-trade majesty”. In the few surviving photos of him, he looks somewhat cold and unfeeling.

He wasn’t. True, in his early years Mill was a dyed-in-the-wool utilitarian. His mentor was Jeremy Bentham, who had argued that the principle underlying all social activity ought to be “the greatest happiness of the greatest number”. The aim of political economy, as economics was then known, was to maximise utility. Like Gradgrind in Charles Dickens’s “Hard Times”, Mill initially followed Bentham in seeing humans as mere calculating machines.

But that was only the young Mill. In his brilliant autobiography, published after his death in 1873, he confided that he grew up “in the absence of love and in the presence of fear”. The result was a breakdown in his early 20s. He later came to believe that there must be more to life than what Benthamites term the “felicific calculus”—the accounting of pleasure and pain.

He turned to the poetry of William Wordsworth and Samuel Taylor Coleridge, which taught him about beauty, honour and loyalty. His new aesthetic sense pushed him away from gung-ho reformism and gently towards conservatism. If the societies of the past had produced such good art, he reasoned, they must have something to offer his age.

Mill did not reject utilitarianism as thoroughly as his contemporary Thomas Carlyle, who argued that only pigs would view the seeking of pleasure as the foundation of all ethics. Instead, Mill qualified it. Unlike Bentham, who thought that pushpin, a board game, was “of equal value with...poetry”, he maintained that some sorts of pleasure were superior to others. He denied that these nuances meant he was no longer a utilitarian at all. What may at first seem a purely virtuous act that engenders no immediate pleasure—being true to your word, say—may eventually come to seem essential to well-being.

This refinement of utilitarianism demonstrated a pragmatism that is one of Mill’s intellectual hallmarks. On many issues it is difficult to pigeonhole his stance, or even to pin down exactly what he believes. Part of what makes him a great thinker is that he qualifies his own arguments. His views evolved over the course of his life, but for most of it he rejected absolutes and recognised the world’s mess and complexity. John Gray, a philosopher, writes that Mill was “an eclectic and transitional thinker whose writings cannot be expected to yield a coherent doctrine.”

Above all, though, like all liberals Mill believed in the power of individual thought. His first big work, “A System of Logic”, argues that humanity’s greatest weakness is its tendency to delude itself as to the veracity of unexamined convictions. He renounced shibboleths, orthodoxies and received wisdom: anything that stopped people thinking for themselves.

He wanted them to be exposed to as wide a range of opinions as possible, and for no idea or practice to remain unchallenged. That was the path to both true happiness and progress. To protect freedom of expression he formulated his “harm principle”: “the only purpose for which power can be rightfully exercised over any member of a civilised community, against his will, is to prevent harm to others,” he wrote in “On Liberty”, his most famous book.

As Richard Reeves’s biography makes clear, Mill thought the coming industrial, democratic age could enable human flourishing in some ways, but hinder it in others. Take free trade, for which he was an enthusiast (despite working for a long time for the East India Company, perhaps the world’s biggest-ever monopoly). He thought free trade increased productivity: “Whatever causes a greater quantity of anything to be produced in the same place, tends to the general increase of the productive powers of the world,” he wrote in “Principles of Political Economy”. He criticised the Corn Laws, tariffs which largely benefited holders of agricultural land.

Yet Mill was even more taken by the philosophical argument for free trade. “It is hardly possible to overrate the value, in the present low state of human improvement, of placing human beings in contact with persons dissimilar to themselves, and with modes of thought and action unlike those with which they are familiar.” This applied to everyone: “there is no nation which does not need to borrow from others.” He practised what he preached, spending a lot of time in France and seeing himself as a sort of interlocutor between the revolutionary passion of French politics and the buttoned-down gradualism of England.

As democracy spread, he anticipated, ideas would clash. He supported the Reform Act of 1832, which, as well as extending the franchise, did away with “rotten boroughs”, constituencies with tiny electorates, often controlled by a single person. He praised France’s move in 1848 to institute universal male suffrage. Each voter’s views would be represented—and each would have reason to be informed. Participation in collective decision-making was for Mill part of the good life.

For the same reason he was an early proponent of votes for women. “I consider [sex] to be as entirely irrelevant to political rights as difference in height or in the colour of the hair,” he wrote in “Considerations on Representative Government”. After becoming an MP in 1865, he presented a petition calling for female suffrage.

Mill believed that society was advancing. But he also foresaw threats. Capitalism had flaws; democracy had an alarming tendency to undermine itself.

Take capitalism first. In 1800-50 average annual real-wage growth in Britain was a pathetic 0.5%. The average working week was 60 hours long. At times life expectancy in some cities dipped below 30. Mill supported trade unions and legislation to improve working conditions.

He worried, though, that capitalism could inflict spiritual damage that would be harder to fix. The pressure to accumulate wealth could lead to passive acceptance of the world as it was—what Mill’s disciples call the “tyranny of conformity”.

Mill loved the idea of a country founded on liberty, but he feared America had fallen into precisely this trap. Americans displayed “general indifference to those kinds of knowledge and mental culture which cannot be immediately converted into pounds, shillings and pence.” Following Alexis de Tocqueville’s premonitions, Mill saw America as the country where there was less genuine freedom of thought than any other. How else could it live with such a huge inconsistency at its heart: a proclamation of liberty for all which co-existed with the institution of slavery?

In praise of experts

Democracy itself threatened the free exchange of ideas in a different way. Mill thought it right that ordinary people were being emancipated. But once free to make their own choices, they were liable to be taken in by prejudice or narrow appeals to self-interest. Give the working classes a vote, and chaos could result.

That in turn might cramp society’s intellectual development, the views of the majority stifling individual creativity and thought. Those who challenged received wisdom—the freethinkers, the cranks, the Mills—might be shunned by “public opinion”. Expertise could be devalued as the “will of the people” reigned supreme. The upshot was frightening. Paradoxically individual freedom could end up being more restricted under mass democracy than under the despotic sovereigns of yore. Mill famously refers to this as “tyranny of the majority”. But he worries just as much about middle-class “respectable” opinion as working-class ignorance. He pondered how to counter the tyrannical tendencies inherent in economic and political liberalism. Experts had a vital role to play, he thought. Progress required people with the time and inclination for serious study—a secular clergy, of sorts, termed the “clerisy” (a word borrowed from Coleridge). The clerisy had a utilitarian justification: its members would devise “rules that would maximise human well-being if we all followed them,” as Alan Ryan, a political theorist, puts it. One solution was to give educated voters greater power. In this dispensation, people who could not read or write, or who had received the 19th-century equivalent of welfare benefits, would not get a vote. (Mill also thought certain citizens of Britain’s colonies, including Indians, were incapable of self-government.) University graduates might get six votes, unskilled workers one. The aim was to give those who had thought deeply about the world more say. The lower orders would be reminded that they required political and moral guidance, though in time more of them would join the ranks of the educated.

Although that approach looks snobbish, or worse, Mill was enlightened for his time. Indeed, he would have approved many of the social changes in the 21st century, including the universal franchise and women’s rights.

There would be much to concern him, too. Take Brexit. Whether or not Mill would have been a Brexiteer, he would have abhorred the referendum. Why get laymen to decide a matter on which they have little knowledge? He would have watched the rise of President Donald Trump, whose anti-intellectualism he would have loathed, and say: “I told you so.” He might have been surprised that America had taken so long to elect a demagogue.

The intellectual climate on both sides of the Atlantic would have depressed him. “[T]he peculiar evil of silencing the expression of an opinion is, that it is robbing the human race,” Mill wrote in “On Liberty”. “If the opinion is right, they are deprived of the opportunity of exchanging error for truth: if wrong, they lose, what is almost as great a benefit, the clearer perception and livelier impression of truth, produced by its collision with error.” He would not be impressed by no-platforming.

He might well argue that, before 2016, liberal thought had succumbed to a tyranny of conformity. Until recently there was little talk in liberal society about the “left behind” or the losers from free trade. Many liberals had fallen into a decidedly unMillian complacency—assuming that all the big arguments had been settled.

No longer. Mr Trump’s victory has prompted liberals to revisit the case for everything from free trade to immigration. Brexit has led to a lively debate about the proper locus of power. And universities have become a battleground over the limits of free speech. Like Mill’s, these are disorienting times—urgently requiring the intellectual flexibility and boldness epitomised by the father of liberalism.

Read more on classical liberal values and thinkers at Economist.com/openfuture