Consequentialism is a moral theory that states that the consequences of one's actions are the basis for any morality or judgment toward that action. Both utilitarianism and ethical egoism are theories within consequentialism that focus on the outcome of conduct as the primary motivation of that action and any critique of whether or not that conduct is ethical. The major difference between utilitarianism and ethical egoism is where those acts are directed.
Utilitarianism focuses on the idea of the greater good. Essentially, this ethical theory intends to maximize good for the the most people. The moral worth of any action is judged by how much good results for all sentient beings. While some individuals may suffer from these actions, utilitarianism holds that the conduct may still be ethical if it does more good for a greater number of people than it harms.
Ethical egoism, also known simply as egoism, holds that moral conduct ought to be judged through self-interest. Egoism states that the good consequences for the individual agent outweigh the consequences placed upon others. In egoism, actions could be considered ethical for the individual if the one taking the action is benefited, while any benefit or detriment to the welfare of others is a side effect and not as important as the consequences for the individual.
The primary differences between these two theories, keeping in mind that there are numerous sub-theories within each branch of thought, is the value placed between the individual and others. In utilitarianism, the most ethical action may be that which harms the individual agent but maximizes the positive impact for the most people overall, essentially placing the emphasis on the whole as opposed to the individual. In egoism, the individual has a greater value than others, thus it is ethical to act in one's own self-interest even if it may potentially harm others.
Utilitarianism seeks to maximize good by minimizing harm to all while egoism seeks to maximize good by keeping the individual happy. In utilitarianism, actions must be judged on the amount of people (or beings) that benefit from the action as opposed to how many the same action may potentially harm. Proponents argue that utilitarianism results in a greater sum of benefit to its harm, based upon outcome and not intention. However, critics of utilitarianism argue that following the interest of the greater good may result in tremendous harm to a large number of individuals.
Meanwhile, egoists argue that acting in self-interest can result in position action because the individual knows best how to benefit his own self, and if everyone were to act in the interest of others, then the general welfare of all would decrease as they are never working for their own good. Egoists trust that others will act in their own interests, thus making it unnecessary to take action solely for their benefit.