other
Discount Calculator
Calculate sale price, amount saved, discount rate, or original price for percent-off and fixed-amount discounts.
other calculator
The Margin Calculator changes formulas based on Margin mode. Profit mode compares cost, revenue, profit margin, markup, and reverse solves; Stock trading mode estimates the amount required from an entered stock price, share count, and margin requirement; Currency exchange mode estimates a margin deposit from an entered exchange rate, unit count, and selected ratio.
Your scenario
Working scenario
Not saved yet
Saved scenarios
Save this result, then use saved scenarios to switch between assumptions.
Use this calculator when you want to check arithmetic relationships from your own pricing, stock-position, or currency-position assumptions. Use Discount or Sales Tax when a retail price changes before or after checkout, ROI when you want return from money invested and returned, Business Loan when borrowing cost matters, Depreciation when asset cost timing matters, and official broker, regulator, exchange, or forex-dealer sources when a real margin account, trade, security, leverage ratio, liquidation rule, or margin call depends on the result.
In profit mode, the app calculates profit = max(0, revenue - cost), profit margin = profit / revenue * 100 when revenue is greater than 0, and markup = profit / cost * 100 when cost is greater than 0. Revenue solve uses revenue = cost / max(0.000001, 1 - margin / 100). Cost solve uses profit = revenue * margin / 100 and cost = revenue - profit, so target margins above 100 percent can produce negative cost. Profit solve uses entered revenue and cost; the visible Profit input is not an independent reverse-solve input in the current implementation. Stock trading mode uses position value = stock price * shares and amount required = position value * margin requirement / 100. Currency exchange mode uses position value = exchange rate * units and margin deposit = position value / selected ratio, with amount required equal to the same deposit.
This formula page covers the app's Margin Calculator: business profit margin and markup, reverse revenue and cost solves from a target margin, a stock-trading required-amount estimate from a user-entered requirement, and a currency-exchange margin deposit from a user-entered exchange rate, units, and selected ratio. It does not look up broker rules, Regulation T status, FINRA maintenance requirements, house requirements, day-trading rules, options or futures margin, forex contract specs, live prices, interest, commissions, liquidation, or margin calls.
profit mode: P = max(0, R - C); m = P / R * 100 when R > 0; k = P / C * 100 when C > 0; revenue solve: R = C / max(0.000001, 1 - m / 100); cost solve: C = R - R * m / 100; stock mode: V_s = SP * Q; A = V_s * MR / 100; FX mode: V_fx = ER * U; DEP = V_fx / L
The selected margin mode changes the meaning of the calculation. Business margin compares profit with revenue, markup compares profit with cost, stock mode multiplies position value by a user-entered requirement, and currency mode divides a notional home-currency value by the selected ratio.| Symbol | Meaning | How this page uses it |
|---|---|---|
| C | Cost | The Cost input in profit-margin mode. |
| R | Revenue | The Revenue input or the revenue solved from cost and target margin. |
| P | Profit | The nonnegative difference between revenue and cost in margin and profit solve modes. |
| m | Profit margin percent | Profit divided by revenue, displayed as Margin. In reverse solves it is the entered target margin percentage. |
| k | Markup percent | Profit divided by cost, displayed as Markup when cost is greater than 0. |
| SP | Stock price | The per-share price entered in stock-trading mode. |
| Q | Share quantity | The Number of shares input in stock-trading mode. |
| MR | Margin requirement percent | The user-entered stock margin requirement. The app does not decide whether it matches a broker, exchange, or regulator requirement. |
| V_s | Stock position value | Stock price multiplied by number of shares. |
| A | Amount required | The estimated amount required for the stock position, or the same value as margin deposit in currency mode. |
| ER | Exchange rate | The entered home-currency exchange rate for the currency-exchange estimate. |
| U | Currency units | The Units input in currency-exchange mode. |
| L | Selected margin ratio | The selected ratio such as 20 for 20:1. It is an input assumption, not a regulatory lookup. |
| V_fx | Currency position value | Exchange rate multiplied by units. |
| DEP | Margin deposit | Currency position value divided by the selected margin ratio. |
The default business example uses $120 cost and $160 revenue. The validation fixtures also cover a 25 percent revenue solve, a $1,830 stock position at a 30 percent user-entered margin requirement, and a 20:1 currency-exchange example.
The calculator is useful for checking arithmetic relationships, but it does not decide whether a business price is sensible, whether a broker will approve a trade, or whether a forex position satisfies current account or regulatory requirements.
Geographic scope: works globally. The math is currency-agnostic, so enter amounts in your own currency; local taxes, fees, and product rules are not included.
They divide the same profit by different bases. Margin divides by revenue: $40 profit on $160 revenue is 25 percent margin. Markup divides by cost: the same $40 on a $120 cost is 33.3 percent markup. The calculator reports both side by side because mixing them up is the classic pricing error - a target 25 percent margin needs a 33.3 percent markup, not 25.
Use the reverse solve: revenue = cost ÷ (1 − margin ÷ 100). To clear a 25 percent margin on a $120 cost, you need $160 revenue - not $150, which is what adding 25 percent to cost gives and which yields only a 20 percent margin. The calculator can also solve the other direction: the maximum cost you can carry given a price and a required margin.
Different meanings of the same word. Stock mode multiplies share price by quantity and applies your entered margin requirement percentage to estimate the deposit a position needs. Currency mode converts units at your entered exchange rate and divides by the leverage ratio for a forex margin deposit. Both are arithmetic from your inputs - no broker's actual requirements, rates, or approval rules are looked up.
This calculator is an original three-mode margin model covering business profit margin versus markup with reverse revenue and cost solves, a stock margin-requirement deposit, and a leveraged currency margin deposit, validated by deterministic fixtures and edge-case tests. It is not copied from a single source.
Fixtures pin the margin-versus-markup denominators on the $120-cost default and both trading-mode deposit calculations. The result remains an educational estimate, not a pricing recommendation or a broker margin requirement.
Formula version 2026.05.22-generic-margin. The version marks the calculation logic and validation fixture set used for this estimate.
Results are educational estimates, not advice. Read the full disclaimer.
other
Calculate sale price, amount saved, discount rate, or original price for percent-off and fixed-amount discounts.
tax
Calculate before-tax price, sales tax rate, after-tax price, and tax amount from any two known values.
investment
Estimate return on investment, gain or loss, and annualized return from investment amounts and time held.
loan
Estimate business loan repayment, total interest, fees, and the real APR after loan costs.
other
Estimate book-value depreciation using straight-line, declining-balance, or sum-of-years-digits methods.