Stock Calculator
This professional-grade Stock Calculator helps investors estimate profit or loss, break-even price, ROI, and the impact of dividends over time. It is designed for individuals and professionals who need fast, accurate, and accessible answers with optional dividend reinvestment and tax scenarios.
Inputs
Results
Taxes are applied to positive capital gains only; dividend taxes are applied whether dividends are reinvested or taken in cash. Reinvestment assumes dividends purchase fractional shares at the current price each year.
Data Source and Methodology
Authoritative source: U.S. Securities and Exchange Commission (SEC), Investor.gov – Compound Interest Calculator and Education Center (2024–2025). Direct link: SEC Investor.gov Compound Interest.
All calculations strictly follow the formulas and data provided by this source.
- Compounding and growth calculations are aligned with SEC compound interest conventions.
- Cost basis, break‑even, and profit/loss formulas use standard finance definitions.
- Dividend reinvestment in this tool assumes purchases at a constant current price for scenario analysis.
The Formula Explained
Cost basis: $$CB = P_0 \cdot N_0 + F_b$$
Break‑even price: $$P_{be} = \frac{CB + F_s}{N_t}$$ where \(N_t\) is shares at time of sale (includes reinvested shares if enabled).
Dividend per share from yield: $$DPS_0 = y \cdot P_c$$
Dividends (no reinvestment, with growth \(g\), years \(T\)): $$D_{tot} = \sum_{i=0}^{\lfloor T \rfloor - 1} N_0 \cdot DPS_0(1+g)^i + \{T\} \cdot N_0 \cdot DPS_0(1+g)^{\lfloor T \rfloor}$$ where \(\{T\}\) is the fractional year.
Reinvested shares (annual, after dividend tax rate \(t_d\)): $$N_t = N_0 \prod_{i=0}^{\lfloor T \rfloor - 1} \left(1 + \frac{DPS_0(1+g)^i (1-t_d)}{P_c}\right)\cdot \left(1 + \{T\}\frac{DPS_0(1+g)^{\lfloor T \rfloor}(1-t_d)}{P_c}\right)$$
Profit pre‑tax (sell at \(P_c\)): $$\Pi_{pre} = P_c \cdot N_t - F_s - CB$$
Profit after‑tax: $$\Pi_{after} = \Pi_{pre} - t_{cg}\cdot \max(\Pi_{pre},0) - t_d \cdot D_{tot}$$
CAGR pre‑tax: $$CAGR = \left(\frac{V_{final}}{CB}\right)^{1/T} - 1,\quad V_{final}=\begin{cases}P_c\cdot N_t - F_s,& \text{reinvest}\\ P_c\cdot N_0 + D_{tot} - F_s,& \text{no reinvest}\end{cases}$$
Glossary of Variables
- Buy price per share (P0): Price paid per share when buying.
- Shares (N0): Number of shares purchased.
- Buy fees (Fb) / Sell fees (Fs): Commissions or transaction fees for buy/sell.
- Current price (Pc): Price per share used to value/exit the position.
- Dividend input: Either Yield (%) or Dividend Per Share ($) on an annual basis.
- Dividend growth (g): Expected annual growth rate in dividends.
- Holding period (T): Investment horizon in years; fractional years supported.
- Capital gains tax (tcg): Tax rate applied to positive capital gains at sale.
- Dividend tax (td): Tax rate applied to dividends (even if reinvested).
- Cost basis (CB): Total initial cost = buy price × shares + buy fees.
- Break‑even price (Pbe): Price where total proceeds equal total costs.
- Market value: Current price × number of shares (includes reinvested shares if enabled).
- Profit (pre/after‑tax): Gain or loss after fees, optionally after taxes.
- CAGR: Annualized return over the holding period.
How It Works: A Step‑by‑Step Example
Suppose you bought 50 shares at $120 with $5 buy fees. Current price is $138, sell fees $5. Dividend yield is 2%, dividend growth 5%, holding period 3 years, reinvest dividends, and assume 15% dividend tax and 15% capital gains tax.
- Cost basis: CB = 120×50 + 5 = $6,005.
- DPS from yield: DPS0 = 0.02 × 138 = $2.76.
- Reinvested shares: each year add (after‑tax dividends / price). After 3 years, shares rise from 50 to approximately 50.30.
- Market value: 138 × 50.30 ≈ $6,943.8.
- Pre‑tax profit: 6,943.8 − 5 − 6,005 ≈ $933.8.
- Dividend taxes paid: about 15% of total dividends (~$4.76 per share compounded), reducing after‑tax profit.
- After‑tax profit: pre‑tax profit minus capital gains tax on gains (~$140.1) minus dividend taxes (≈$20.9) ≈ $772.8.
Numbers are rounded for readability. Actual results may vary with rounding and dividend schedules.
Frequently Asked Questions (FAQ)
What does “reinvest dividends” change?
It compounds your share count by purchasing fractional shares with after‑tax dividends at the current price. Your market value reflects these extra shares.
Why is dividend yield converted using current price?
Dividend yield is typically quoted as DPS ÷ price. Using the current price aligns with market data conventions and forward estimates.
How are taxes applied?
Capital gains tax applies to positive gains only at sale. Dividend tax applies to dividends regardless of reinvestment and reduces cash available to reinvest.
Does the calculator support fractional years?
Yes. For partial years, dividends scale proportionally and reinvestment includes a proportional final-period top-up.
Can I model commission-free trading?
Set buy and sell fees to $0 to simulate commission-free brokers.
Is the current price required?
Yes. It determines market value, profit/loss, and break‑even computations.
Is this tool financial advice?
No. This is an educational calculator. Do your own research and consult a professional if needed.