Subtract the cost of making something (manufacturing, etc.) from the revenue you get from that product, aka the markup, and voilà! Gross margin.