Utilitarianism is one type or kind of consequentialist duty ethics. It focuses upon what actions can be said to be right or wrong, that which ought to be done or that which ought not to be done by a moral agent, according to the consequences the action produces.
Jeremy Bentham (1748-1832): "Nature has placed mankind under the governance of two sovereign masters, pain and pleasure. It is for them alone to point out what we ought to do, as well as to determine what we shall do. . . . By the principle of utility is meant that principle which approves or disapproves of every action whatsoever, according to the tendency which it appears to have to augment or diminish the happiness of the party [or parties] whose interest is in question." In short, one ought to act so as to produce the greatest happiness for the greatest number.
Bentham's Felicific Calculus
The value of a pleasure or pain will be greater or less according to the following seven measurable elements or dimensions:
One calculates these dimensions of pleasures and pain that flow from each act for each agent involved. The summation of overall pains and pleasures for each act thus indicate that act one has a duty to perform, being that act which maximises pleasures (or, if all options lead to pain, then the least pain). So the calculation is not simply about the actor's own greatest happiness, but the maximization of happiness for the greatest number of agents affected by the action.
Act utilitarianism (represented by Jeremy Bentham): one calculates what is right or ought to be done on the basis of comparing the consequences for all relevant agents of (at least two) alternative acts it is possible to perform in the given circumstances or specific setting at the particular time the act will be performed. Permits use of 'rule of thumb' when time does not permit calculation
Rule utilitarianism (represented by J.S. Mill): one calculates what is right or ought to be done on the basis of comparing the consequences for all relevant agents of (at least two) alternative rules it is possible to apply in the given circumstances or specific setting at the particular time and all relevantly similar circumstances or settings at any time.