The margin is the share of the selling price you keep as profit, as a percentage of the price. It is worked out like this: (price − costs) ÷ price × 100.
An example: you buy at €50 and sell at €100 without VAT. The profit is €50, the margin is 50%. Online, the costs also include the marketplace fee, shipping and the payment cost: the real margin is almost always lower than it looks.
It should not be confused with the markup, which is worked out on the cost: in the same example the markup is 100%. If the price includes VAT, take it out first, as explained under taking VAT out of a price.