Utilitarianism is a work both of personal and of social morality; that is, it contains precepts relevant to the question of how each one of us should live our lives, and to the issue of how society’s legal and moral institutions should be arranged. Ultimately, of course, the book suggests that both our own lives and the institutions of society should be such that welfare overall is maximized.
Utilitarianism was published in 1861, On Liberty in 1859, and they were written almost contemporaneously. The earlier book is more directly concerned with social morality, its subject being ‘the nature and limits of the power which can be legitimately exercised by society over the individual’ (L 1.1).
Mill saw this question as vitally important, and since he provided at least an implicit answer to it in Utilitarianism, we must now attempt to understand the relation of the two works.