For defined-risk options structures, position size is arithmetic: a per-trade risk budget in dollars divided by the maximum loss per contract, rounded down, is the contract count that fits the budget. This calculator does that arithmetic on numbers the reader supplies; the risk budget itself is the reader's own decision.
Arithmetic on the numbers entered above. What risk budget fits a given account is the reader's own decision.
A defined-risk structure states its worst case at entry: for a vertical spread, the width between strikes minus the credit received (or the debit paid), times one hundred per contract. Sizing from that number means the question "how bad can this get" is answered before entry rather than during a drawdown. The position sizing article covers the reasoning; this page is the arithmetic.
A $25,000 account with a 2 percent per-trade budget has $500 of risk budget. A 5-wide credit spread collecting $1.50 has a maximum loss of (5.00 - 1.50) x 100 = $350 per contract. One contract fits the budget; two contracts would put $700 at risk, above the $500 budget, so the floor function returns one. The worst case actually taken is $350, or 1.4 percent of the account.
Rounding down means small accounts often get a contract count of zero for wide spreads; the honest reading is that the structure does not fit the budget, not that the budget is wrong. Correlated positions also share risk that per-trade arithmetic does not see: five spreads on five index-tracking names are closer to one large position than five small ones, the aggregation problem treated in portfolio greeks.