Margin: Margin is the share of the selling price that is left after costs, expressed as a percentage of the price, so a 25% margin means a quarter of every sale is profit.
Margin answers the question “of the money the buyer paid, how much did I keep?” It is calculated on the selling price:
margin = (price - cost) / price
Example: a part costs you €60 to make and you sell it for €80. The profit is €20, and the margin is €20 / €80 = 25%.
Margin is the figure accountants and lenders use, because it compares directly with revenue. It can never reach 100%, since that would mean the part cost nothing.
The most common confusion is with markup, which divides the same profit by cost instead of by price. In the example above the markup is €20 / €60 = 33%. A shop that means to earn a 30% margin but adds 30% markup ends up with a margin of about 23%. On a year of orders, that gap is real money.
Gross margin usually counts only the direct costs of the job (machine time, material, labour). Net margin also subtracts overhead. Make sure you know which one a target refers to before you build it into a price.
For the arithmetic side by side, with a conversion table, read margin vs markup.
Go deeper: Margin vs markup for manufacturers, with a conversion table