Margin and markup are related but not the same
Gross profit is the simplest part of the calculation: selling price minus cost. Gross margin turns that profit into a percentage of revenue, while markup turns the same profit into a percentage of cost. Because the bases are different, margin and markup are not interchangeable numbers even when they are calculated from the same sale.
That difference is one reason a margin calculator is useful. Many people know the cost and selling price but want to know whether the resulting margin is healthy. Others know the cost and want to add a markup to reach a selling price. A practical calculator should help with both views.