Graphically if the supply and demand curves are linear consumer surplus is measured as the triangle:

under the demand curve and above the actual price.