inyourbrowser.com

ROI calculator

ROI calculator is a finance tool that measures return on investment for any cost-versus-gain scenario. It supports simple ROI, annualized ROI for multi-year holdings, and marketing ROI for ad spend, and outputs the percentage, net gain, and multiplier on the original outlay. The tool runs in your browser.

ROI: 20.00%.

Calculation mode

Currency

Formula: ROI % = ((gain - cost) / cost) x 100

ROI

20.00%
Net gain
$2,000.00
Multiplier
1.20x
Initial cost
$10,000.00
Final value (total returned)
$12,000.00

Calculations are estimates for informational purposes only. Consult a financial professional for advice.

How to calculate ROI

  1. Select the mode: simple ROI, annualized ROI, or marketing ROI.
  2. Enter the cost or ad spend.
  3. Enter the final value or attributed revenue.
  4. For annualized ROI, also enter the holding period in years.

Technical specification

  • Algorithm or formula: Simple ROI ((gain - cost) / cost) * 100. Annualized ROI uses the CAGR formula ((gain / cost)^(1 / years) - 1) * 100. Marketing ROI ((revenue - spend) / spend) * 100; ROAS is revenue / spend.
  • Browser API or library: Pure JavaScript arithmetic with Math.pow for the CAGR exponent; no external library.
  • Input limits: Cost and gain accept any IEEE 754 double-precision value. Holding period 0.01–100 years for annualized mode.
  • Output: ROI percentage, net gain or loss, and multiplier (gain divided by cost). Annualized mode also shows the total return and per-year equivalent.
  • Known limitations: Returns Infinity or NaN when cost is zero. Ignores taxes, fees, inflation, and risk-adjusted measures (e.g., Sharpe ratio).

Frequently asked questions

What is the simple ROI formula?
ROI % = ((gain - cost) / cost) x 100. An investment of 10,000 that returns 12,000 has a net gain of 2,000 and an ROI of 20%, which is a 1.2x multiplier on the original money. Calculations are estimates for informational purposes only. Consult a financial professional for advice.
When should I use annualized ROI?
Use annualized ROI to compare investments held for different lengths of time. The formula is ((gain / cost)^(1 / years) - 1) x 100, which expresses the total return as an equivalent constant per-year rate.
What is the difference between ROI and ROAS?
Return on ad spend (ROAS) is revenue divided by spend, expressed as a multiplier. Marketing ROI subtracts the spend first, then expresses the net as a percentage. A 4x ROAS is the same as a 300% marketing ROI.
Is my financial data sent to a server?
All calculations run locally in your browser as JavaScript. Costs, gains, and revenue figures are not transmitted.

Calculations are estimates for informational purposes only. Consult a financial professional for advice.

Reviewed and tested May 26, 2026.