# Sharpe ratio calculator: annualized, from your returns

URL: https://fincodelabs.com/en/tools/sharpe-ratio-calculator · Publisher: Fincode (Fincode Yazılım ve Teknoloji A.Ş.), Istanbul, Turkey · Updated: 2026-10-15

Paste a list of periodic returns, enter the annual risk-free rate and how many periods make a year to see the mean, the standard deviation and the annualized Sharpe ratio of those returns. Free, no sign-up required.

## Calculator

The calculation runs in the browser in the form on this page: https://fincodelabs.com/en/tools/sharpe-ratio-calculator

**Inputs**
- Returns (%), one per period: Oldest first, one per line; tabs and semicolons also separate values. Up to 10,000 values, read in your browser and sent nowhere
- Risk-free rate (annual %): Optional; spread evenly over the periods of a year. Empty means 0 (default: 2.4)
- Periods per year: How often the returns were measured

**Results:** Annualized Sharpe ratio, Sharpe ratio per period, Returns counted, Mean return per period, Standard deviation per period (n − 1), Mean excess return per period, Annualized standard deviation

> All default values are hypothetical. The Sharpe ratio is backward-looking: it describes the returns you paste and says little about future ones, and this page offers no threshold for a good ratio.

## Sharpe ratio formula

The Sharpe ratio is the average excess return per unit of its standard deviation. The calculator works per period and then annualizes:

**Excess return = return − annual risk-free rate ÷ periods per year**

**Sharpe ratio per period = mean excess return ÷ standard deviation of the excess returns**

**Annualized Sharpe ratio = Sharpe ratio per period × √(periods per year)**

The standard deviation is the sample one, with n − 1 in the denominator. William Sharpe's 1994 article defines the historic, or ex post, ratio as the average differential return over the period divided by its standard deviation, and its formula for that deviation uses T − 1.

## Worked example

> **Hypothetical example:** twelve monthly returns of 1.8, −0.6, 2.4, 0.9, −1.7, 1.2, 0.5, −0.9, 2.1, −1.3, 1.6 and 0.6%, a risk-free rate of 2.4% a year and 12 periods a year. These are the calculator's default values, not anyone's real results.
>
> Mean return: 6.6 ÷ 12 = 0.55% a month. Risk-free rate per month: 2.4 ÷ 12 = 0.2%, so the mean excess return is 0.35%. Sample standard deviation: 1.3801%. Sharpe ratio per month: 0.35 ÷ 1.3801 = 0.254. Annualized: 0.254 × √12 = **0.88**.

**The same twelve hypothetical returns under three conventions. The data do not change; only the arithmetic does.**

| Convention | Annualized Sharpe ratio |
| --- | ---: |
| Sample deviation (n − 1), risk-free 2.4% a year | 0.88 |
| Population deviation (n), risk-free 2.4% a year | 0.92 |
| Sample deviation (n − 1), risk-free 0 | 1.38 |

## Why tools give different Sharpe ratios

Two programs can report different ratios for the same returns because they make different choices, not because one of them is wrong.

- **Sample or population deviation:** NumPy's std divides by N by default (ddof=0), while pandas' Series.std divides by N − 1 (ddof=1). With twelve returns that alone moves the example from 0.88 to 0.92.
- **Risk-free rate:** TradingView's help describes a Sharpe ratio built from monthly returns with a default risk-free rate of 2% a year, which a script can change. MetaTrader 5's testing report says its strategy tester takes the risk-free rate as zero.
- **Period:** daily returns are annualized with √252 or √365 and monthly ones with √12, so mixing data and factor gives a wrong figure.
- **Returns:** simple and log returns, and returns with or without fees, give different series.

Compare ratios only when the data and the conventions match. TradingView's tester and its metrics are covered in the [TradingView strategy tester guide](https://fincodelabs.com/en/blog/tradingview-strategy-tester).

## What a Sharpe ratio cannot tell you

A ratio computed from past returns describes those returns. Sharpe's own article says that using unadjusted historic ratios as stand-ins for unbiased predictions of future ones is subject to serious question.

- **Annualizing** by √(periods) assumes returns are not correlated from one period to the next; the article notes that returns may be serially correlated, and that even independent returns can show it in a given sample.
- **The standard deviation** counts gains and losses alike and says nothing about the depth of a fall; see the [max drawdown calculator](https://fincodelabs.com/en/tools/max-drawdown-calculator) for that.
- **A short record** gives a rough estimate: a few periods more or fewer can move it a lot.

This page offers no figure above which a ratio counts as good, and no ratio here is a forecast or a recommendation.

## Pasting returns, and the same calculation in Python

Put one return per line, in percent, oldest first; a % sign, a plus sign and tabs or semicolons between values also work. Use a dot for decimals: a line such as 1,5 is reported as not a number rather than guessed. Up to 10,000 values are read in your browser, and nothing is sent anywhere.

The example in Python with NumPy, tested on 6 November 2026; the second line uses NumPy's default deviation:

```python
import numpy as np

r = np.array([1.8, -0.6, 2.4, 0.9, -1.7, 1.2, 0.5, -0.9, 2.1, -1.3, 1.6, 0.6]) / 100
excess = r - 0.024 / 12                      # 2.4% a year, spread over 12 months
print(round(excess.mean() / excess.std(ddof=1) * np.sqrt(12), 2))  # 0.88
print(round(excess.mean() / excess.std() * np.sqrt(12), 2))        # 0.92, ddof=0
```

## Which values to enter

- **Returns:** periodic returns in percent, one per period, such as monthly returns of a strategy or a fund.
- **Risk-free rate:** an annual rate in the same currency as the returns, typed by you; the page fetches no rates. Empty means 0.
- **Periods per year:** 252 for trading days, 365 for calendar days, such as crypto markets that trade every day, 52 for weeks, 12 for months.

## Frequently asked questions

### How do you calculate the Sharpe ratio?

Subtract the risk-free rate for each period from each return, then divide the mean of those excess returns by their standard deviation. For an annual figure, multiply by the square root of the number of periods in a year.

### How do I annualize a Sharpe ratio?

Multiply the per-period ratio by the square root of the periods per year: √12 for monthly returns, √252 for trading days. This assumes returns are not correlated from one period to the next.

### What is a good Sharpe ratio?

This page sets no threshold. The ratio describes past returns and changes with the conventions used, so it is best compared only across records measured the same way.

### Should I use the sample or the population standard deviation?

The calculator uses the sample deviation, n − 1, as Sharpe's article does. NumPy's default is the population deviation, so state which one you used when you compare figures.

### Why is my Sharpe ratio different from my platform's?

Platforms differ in the return period, the risk-free rate and the deviation they use. TradingView describes monthly returns with a 2% default rate, and MetaTrader 5's tester takes the rate as zero.

## Sources

- [William F. Sharpe: The Sharpe ratio, The Journal of Portfolio Management, Fall 1994 (reprint on Stanford University's site)](https://web.stanford.edu/~wfsharpe/art/sr/sr.htm)
- [NumPy 2.5 manual: numpy.std (ddof)](https://numpy.org/doc/stable/reference/generated/numpy.std.html)
- [pandas 3.1 documentation: pandas.Series.std (ddof)](https://pandas.pydata.org/docs/reference/api/pandas.Series.std.html)
- [TradingView Help Center: Sharpe ratio](https://www.tradingview.com/support/solutions/43000681694/)
- [MetaTrader 5 Help: Testing report (Sharpe ratio, risk-free rate)](https://www.metatrader5.com/en/terminal/help/algotrading/testing_report)

> This calculator is general information, not tax, legal or investment advice. Results depend on the values you enter; fees, margin rules and tax rules differ by exchange and country and change over time, so check the official source and ask a licensed adviser about your own situation. Sources, checks and corrections: see the [editorial policy](https://fincodelabs.com/en/editorial-policy).

---

Published by Fincode (Fincode Yazılım ve Teknoloji A.Ş.), a software company in Istanbul, Turkey: https://fincodelabs.com/en/tools/sharpe-ratio-calculator

Cite as: Fincode, "Sharpe ratio calculator: annualized, from your returns", updated October 15, 2026, https://fincodelabs.com/en/tools/sharpe-ratio-calculator
