Profit formula
Profit = revenue − cost.
Margin formula
Profit margin = profit ÷ revenue × 100.
Example
If you sell something for 100 and it costs 60, profit is 40. The profit margin is 40%.
Margin vs markup
Margin compares profit to selling price. Markup compares profit to cost. They are not the same number.