In mainstream economics, economic surplus, also known as total welfare or Marshallian surplus (named after Alfred Marshall), refers to two related quantities. Consumer surplus or consumers' surplus is the monetary gain obtained by consumers because they are able to purchase a product for a price that is less than the highest price that they would be willing to pay. Producer surplus or producers' surplus is the amount that producers benefit by selling at a market price that is higher than the least that they would be willing to sell for; this is roughly equal to profit (since producers are not normally willing to sell at a loss, and are normally indifferent to selling at a breakeven price).
In Marxian economics, the term surplus may also refer to surplus value, surplus product and surplus labour.
An engineer named Jules Dupuit came up with the concept of economic surplus, but it was the economist Alfred Marshall who gave the concept its fame in the steam of economics.
On a standard supply and demand diagram, consumer surplus is the area (triangular if the supply and demand curves are linear) above the equilibrium price of the good and below the demand curve. This reflects the fact that consumers would have been willing to buy a single unit of the good at a price higher than the equilibrium price, a second unit at a price below that but still above the equilibrium price, etc., yet they in fact pay just the equilibrium price for each unit they buy.
Likewise, in the supply-demand diagram, producer surplus is the area below the equilibrium price but above the supply curve. This reflects the fact that producers would have been willing to supply the first unit at a price lower than the equilibrium price, the second unit at a price above that but still below the equilibrium price, etc., yet they in fact receive the equilibrium price for all the units they sell.
Consumer surplus is the difference between the maximum price a consumer is willing to pay and the actual price they do pay. If a consumer would be willing to pay more than the current asking price, then they are getting more benefit from the purchased product than they initially paid. An example of a good with generally high consumer surplus is drinking water. People would pay very high prices for drinking water, as they need it to survive. The difference in the price that they would pay, if they had to, and the amount that they pay now is their consumer surplus. Note that the utility of the first few liters of drinking water is very high (as it prevents death), so the first few litres would likely have more consumer surplus than subsequent liters.