Quick answer
How does the calculator annualize a stock return?
For one purchase and one sale, the calculator compounds the total return over the entered holding period. With Position history and complete dates, it solves for the annual rate that makes the net present value of all modeled cash flows equal to zero.

- 1
Exact-date annualization. The 19.78% result uses the displayed August 30, 2025 to August 30, 2026 holding period.
- 2
Negative cash flow. Total cost basis is the purchase-side cash outflow assigned to the modeled sale.
- 3
Positive cash flow. Net proceeds are the sale-side cash inflow after the Sell commission.
One purchase and one sale
Annualize a return from the holding period
The default example produces $1,980 in Net profit on $10,010 of cost basis, or 19.78% ROI.
If the same total return occurred over six months, the annualized result is approximately (1 + 0.197802)2 - 1 = 43.47%. This is a mathematical rate for comparison, not a forecast that the trade will repeat.
Enter exact Purchase date and Sale date when available. The quick workflow uses the Actual/365 Fixed convention; a month count remains an estimate of the holding period.
Six-month example
19.78% total return becomes 43.47% annualized
Compounding a six-month result to a yearly rate can create a much larger percentage. That does not mean the position actually earned 43.47% in dollars.
- Cost basis
- $10,010.00
- Net profit
- $1,980.00
- Total ROI
- 19.78%
- Holding period
- 6 months
- Annualized return
- 43.47%
Irregular cash flows
Use XIRR for multiple dated transactions
A position built over time cannot be annualized accurately as if all capital was invested on the first purchase date.
Record negative cash flows
Each purchase value and its Buy commission is placed on the purchase date.
Record dated inflows
Each dividend is a positive cash flow on its payment date.
Record net proceeds
Included previous sales and the current modeled sale are positive dated cash flows.
Find the zero-NPV rate
XIRR finds an annual rate that discounts the combined cash-flow series to zero.
For a position with several buys, continue with How to Calculate Stock Profit with Multiple Purchases.
Dated cash-flow example
Two purchases, a dividend, and one sale produce a 12.65% XIRR
Assume $6,000 is invested on January 1, 2025, another $4,000 on July 1, a $200 dividend is received on September 30, and the sale returns $10,800 on January 1, 2026.
Total positive cash flow is $11,000, so the simple gain is still $1,000 on $10,000 invested. XIRR is approximately 12.65% because the second $4,000 was invested for about half the period and the dividend arrived before the final sale.
| Date | Transaction | Cash flow | XIRR treatment |
|---|---|---|---|
| January 1, 2025 | First purchase | -$6,000.00 | Negative on purchase date |
| July 1, 2025 | Second purchase | -$4,000.00 | Negative on purchase date |
| September 30, 2025 | Dividend | +$200.00 | Positive on payment date |
| January 1, 2026 | Net sale proceeds | +$10,800.00 | Positive on modeled sale date |
Required dates
Why XIRR may be unavailable
Missing dates
Every relevant purchase, included sale, dividend, and current sale needs a valid date.
Invalid chronology
A dividend must occur after the earliest relevant purchase and no later than the modeled sale.
No sign change
The cash-flow series must contain at least one negative value and one positive value.
No valid solution
Some non-conventional cash-flow patterns may have no solution or more than one theoretical internal rate of return.
| Measure | Inputs | What it answers | Main limitation |
|---|---|---|---|
| ROI | Profit and assigned basis | Total gain or loss relative to invested basis | Does not reflect time |
| Annualized return | One purchase, one sale, holding period | Equivalent compounded yearly rate | Assumes one starting investment |
| XIRR | Fully dated irregular cash flows | Annual rate that sets modeled NPV to zero | Requires valid dates and a solvable cash-flow series |
Methodology and references
Interpret annualized returns as comparison metrics
Annualized return and XIRR describe modeled historical or hypothetical cash flows. They are not predictions, tax results, or guarantees of future performance.
Ready to calculate annualized return or XIRR?
Use the Stock Profit Calculator