Skip to content
Mycelgrid

User Manual

Margin Calculator Manual

Choose the pair of values you already know. The calculator solves the remaining cost, selling price, gross profit, gross margin, and markup values live, without a Calculate button.

Default: Cost + selling price

Enter Cost and Selling price. Gross profit is Selling price − Cost. Gross margin divides that profit by Selling price; markup divides it by Cost. Cost and Selling price may be zero, but they may not be negative.

Target margin pricing

Cost + target margin uses Selling price = Cost ÷ (1 − Margin ÷ 100). Cost must be greater than zero and target margin must be less than 100%. A 100% target margin on positive cost would require no finite selling price.

Price rounding can leave the exact result unchanged, round to the nearest cent, round up to a cent, or round down to a cent. After rounding, the calculator recomputes actual margin and markup from the rounded selling price.

Markup pricing

Cost + markup uses Selling price = Cost × (1 + Markup ÷ 100). A markup of −100% produces a zero selling price. Markup below −100% would imply a negative selling price and is rejected.

Other solve pairs

More ways to solve includes Cost + gross profit, Selling price + gross profit, Selling price + markup, Gross profit + margin, and Gross profit + markup. The app checks the solved Cost and Selling price so a pair that would require a negative monetary base is rejected.

Margin ↔ markup conversion

Margin and markup can be converted without a currency amount. Enter either percentage and leave the other blank. The formulas are Markup = Margin ÷ (1 − Margin) and Margin = Markup ÷ (1 + Markup), using decimal rates internally. If both are entered, the app verifies that they are equivalent.

This conversion does not establish Cost, Selling price, or Gross profit because percentages alone do not provide monetary scale.

Zero values and losses

Cost 0 and Selling price above 0 gives 100% margin while markup is undefined. Selling price 0 and positive Cost gives −100% markup while margin is undefined. If both are zero, gross profit is zero and both percentages are undefined. Undefined values are never displayed as Infinity.

Selling below cost is valid: a Cost of 120 and Selling price of 100 gives gross profit −20, margin −20%, and markup approximately −16.666667%.

Quantity totals

Quantity is optional and must be greater than zero when entered. It multiplies per-unit Selling price, Cost, and Gross profit into Total revenue, Total cost, and Total gross profit. Margin and markup remain the same because all monetary values scale together.

Input and precision rules

Use ordinary decimal notation with digits before the decimal point, up to 30 numeric digits total and 12 fractional digits. Exponent notation, grouping commas, a plus prefix, NaN, and Infinity are rejected.

The engine uses exact BigInt rational arithmetic for calculation truth. Terminating values through 12 decimal places are displayed exactly. Other results use up to 6 decimal places or scientific notation when needed. Rounded values are marked ≈, and meaningful tiny non-zero values are not silently changed to zero.

Copy, print, examples, and reset

Copy result copies the active valid calculation, solved values, formula, quantity totals, and target/actual margin information when applicable. Print / Save as PDF opens the browser print surface for the current valid calculation.

Local page memory

Mode drafts live only in this browser page. The app does not create an account, upload the numbers, maintain an app-owned calculation history, or place the current calculation in a shared URL. Share App shares only the canonical app URL.

Scope

This calculator handles gross profit relationships among Cost, Selling price, Margin, and Markup. It does not calculate net margin, operating margin, contribution margin, break-even, taxes, VAT, processing fees, marketplace fees, shipping, discounts, returns, advertising costs, overhead, payroll, or industry benchmarks.