# ROI Calculator

- **URL:** https://codeasystem.com/calculators/finance/roi-calculator/
- **Category:** finance
- **Description:** Compute return on investment as a percentage, with an optional annualized (CAGR) view when you enter a holding period.
- **Primary output:** Return on investment: 25%

## Inputs
- Amount invested (name: `initial`, type: number, prefix: $, example: 12000)
- Final value (name: `final`, type: number, prefix: $, example: 15000)
- Holding period (optional) (name: `years`, type: number, example: 2.5)

## Outputs
- Return on investment: 25%
- Net profit: $3,000.00
- Annualized return (CAGR): 9.34%

## Formula / methodology
```
ROI = (Final − Initial) / Initial     CAGR = (Final / Initial)^(1/years) − 1
```

ROI expresses profit as a share of what you put in. Because ROI ignores time, we also annualize it when you provide a holding period; a 25% gain in two years is very different from 25% in twenty.

## Assumptions & limitations
- No contributions or withdrawals during the holding period.
- All costs of the investment are included in the initial amount.
- Ignores taxes and transaction fees unless you fold them in.

## Example
Turning $12,000 into $15,000 is a 25% ROI; achieved over 2.5 years, that is a 9.34% annualized return.

Result for these inputs:

```
Return on investment: 25%
```

## About this calculator
### ROI’s strength and weakness

Its simplicity makes ROI universal; marketing campaigns, renovations, courses and stocks can all be compared in one percentage. But raw ROI hides time: always ask “over how long?” before acting on the number.

### When to annualize

Compare anything held for different lengths of time using the CAGR row instead. Two investments with identical ROI can have wildly different quality once time enters the picture.

## FAQs
### Should I include fees in the initial amount?

Yes; adding commissions, closing costs or platform fees gives a truer picture of net return.

### What if the final value is lower than the initial?

ROI goes negative and the calculator reports the loss honestly; annualized figures still compute for positive ending values.

### Is ROI the same as profit margin?

No. Margin compares profit to revenue; ROI compares profit to invested capital.

## Related calculators
- [CAGR Calculator](https://codeasystem.com/calculators/finance/cagr-calculator/)
- [Compound Interest Calculator](https://codeasystem.com/calculators/finance/compound-interest-calculator/)
- [ROAS Calculator](https://codeasystem.com/calculators/marketing/roas-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/finance/roi-calculator/)
