1. Calculators
  2. Stock Market & Equity

Correlation Calculator

Paste prices or returns for two stocks, ETFs or currency pairs and see how closely they move together: the Pearson correlation of returns, R², a confidence range and a rolling correlation chart.

Updated Oct 16, 2026Free · no sign-upFormulas tested

Your inputs

Paste closing prices (or returns in percent) for two stocks, an ETF or an index, oldest first and for the same dates.

Enter two tickers to fill one year of daily closing prices for each, matched by date. You can change any value afterwards.
Your data
Example: 31 daily closes. A column copied from a spreadsheet works.
Same dates as stock A, in the same order.
periods
Number of returns in each point of the rolling chart.

Results

Correlation of returns0.60Moderate positive relationship, Pearson coefficient from 30 pairs of returns
Interpretation
Moderate positive
R² (shared variance)
35.7%
Share of one series’ variance that moves in line with the other
Observations (returns)
30
From 31 prices in each list
95% confidence range
0.30 to 0.79
Correlation of price levels
0.92
For comparison only: trending prices inflate it
Rolling 10-period range
0.15 to 0.83

The returns share 36% of their variance: a moderate positive link. With 30 observations the true value could plausibly lie anywhere from 0.30 to 0.79.

Rolling 10-period correlation of returns

00.20.40.60.811591317212529Full period 0.60

Each point is the correlation of the previous 10 returns. The dashed line is the correlation over the whole sample.

Results are estimates from the numbers you enter. They are not financial, tax or legal advice.

How to use the correlation calculator

The calculator has two tools that work the same way. Two stocks is for shares, ETFs and indices. Two currency pairs lets you name the pairs so the labels and the explanation match your trade.

  1. Choose your data type. Pick Prices to paste closing prices, or Returns % if you already have period returns, for example from a spreadsheet or a portfolio report.
  2. Paste the two series, oldest first, for exactly the same dates. A column copied from a spreadsheet pastes directly. With prices, the calculator needs one more value than the number of returns: 31 closes give 30 returns.
  3. Choose the currency pairs on the forex tab. The pair names only change the labels; the maths is the same.
  4. Set the rolling window, the number of returns used for each point on the chart. Ten daily returns show short-term swings; 60 or more give a smoother line if you have the data.

The results show the correlation of returns with a plain-words interpretation, R², the number of observations, a 95% confidence range and the rolling range. In price mode you also see the correlation of raw price levels, for comparison.

How correlation is calculated

The calculator uses the Pearson correlation coefficient of returns:

rt = Pt ÷ Pt−1 − 1
ρ = Σ (at − ā)(bt − b̄) ÷ √[ Σ (at − ā)2 × Σ (bt − b̄)2 ]
R2 = ρ2Pt is the closing price in period t; at and bt are the returns of the two series and ā and b̄ their averages. ρ always lies between −1 and +1.

A value of +1 means the two returns always move in exact proportion in the same direction; −1 means they always move in exact proportion in opposite directions; 0 means no linear relationship. The confidence range uses the Fisher z-transformation, the standard method for a sample correlation:

z = atanh(ρ),   range = tanh(z ± 1.96 ÷ √(n − 3))n is the number of returns. The range narrows as n grows.

A worked example

Two stocks. The example holds 31 daily closes for two companies in the same sector, which become 30 pairs of returns. Their correlation of returns is 0.60, a moderate positive relationship. R² is 35.7%: a little over a third of each stock’s daily variance lines up with the other’s.

With only 30 observations, the estimate is loose. The true correlation could plausibly be anywhere from 0.30 to 0.79.

Two currency pairs. The forex tab holds 31 daily closes of EUR/USD and GBP/USD. Their returns correlate at 0.71, a strong positive relationship, and the rolling 10-day correlation moved between 0.46 and 0.80 over the month.

Why you must correlate returns, not prices

Price levels are a running total of every past move, so any two series that drift the same way look related even if they have nothing in common: a spurious correlation. Returns strip out the trend and compare what actually happened each period.

Data Two unrelated stocks that both rose The two example stocks
Correlation of price levels 0.91 0.92
Correlation of returns -0.01 0.60

The first column comes from two simulated stocks whose daily moves were generated independently. Their prices correlate strongly because both climbed during the month, but their returns show essentially no link. That is why this calculator converts prices to returns before measuring anything.

How to read the result

  • Sign. Positive means the two tend to rise and fall together; negative means one tends to rise when the other falls.
  • Size. Rules of thumb treat 0.7 or more as strong and below 0.2 as negligible, but the thresholds vary. What matters more is how the number changes your decisions: two stocks correlated at 0.9 offer little diversification against each other, while a correlation near zero offers a lot.
  • R². Squaring the correlation tells you how much of the movement is shared. A correlation of 0.5 sounds substantial, yet it means only a quarter of the variance is common.
  • Sample size. Thirty observations give a wide confidence range. Two years of daily data, or five years of monthly data, give a far more reliable figure.
  • Stability. The rolling chart shows whether the relationship held throughout the sample. Correlations between stocks often rise sharply in market sell-offs, exactly when diversification is needed most. A longer window smooths the line: with a 20-day window, the example’s rolling correlation ranges from 0.49 to 0.60.

Correlation in forex trading

Currency pairs share currencies, so many of them are linked by construction. Forex traders use correlation in three main ways.

Avoiding doubled risk. EUR/USD and GBP/USD have both been driven largely by the US dollar and have tended to move in the same direction. A long position in each is closer to one large dollar-short trade than to two independent ideas, so the combined risk is larger than either stop-loss suggests.

Spotting offsetting positions. EUR/USD and USD/CHF have the dollar on opposite sides, and have tended to move in opposite directions. Buying both mostly cancels out: you pay two spreads for a small net exposure. The forex hedging calculator uses this idea deliberately, sizing a position in a correlated pair to offset another.

Confirming or questioning a signal. When a pair breaks out but its usual partner does not follow, some traders read that as a warning.

Currency correlations are not fixed. Central bank decisions, risk sentiment and country-specific news can weaken or reverse a relationship for weeks at a time, so measure it on recent data with the same closing time for both pairs.

Limitations

  • Linear only. Pearson correlation measures straight-line relationships. Two assets can be strongly linked in a crisis and unrelated the rest of the time, and the average hides it.
  • Correlation is not causation. Two stocks may correlate because both respond to the same interest-rate news, not because one drives the other.
  • Dates must match. Missing days, holidays in one market but not the other, or different closing times shift the returns and pull the correlation toward zero.
  • No trading verdict. A historical correlation says nothing about whether a pairs trade or hedge built on it will be profitable after costs.
  • Outliers matter. One extreme day can move the coefficient noticeably in a short sample. Check the rolling chart for sudden jumps.

Frequently asked questions

How do you calculate the correlation between two stocks?
Turn each stock's closing prices into period returns, then compute the Pearson correlation of the two return series: their covariance divided by the product of their standard deviations. Using 31 daily closes for each stock gives 30 pairs of returns. In the example, the two stocks have a correlation of 0.60.
Should I use prices or returns to measure correlation?
Returns. Two price series that both trend upward will show a high correlation even if their day-to-day moves are unrelated. In the example of two unrelated rising stocks, the price levels correlate at 0.91 while the returns correlate at -0.01. The calculator accepts prices for convenience but always correlates the returns.
What is a strong correlation?
A common rule of thumb treats 0.7 or more (or −0.7 or less) as strong, 0.4 to 0.7 as moderate, 0.2 to 0.4 as weak and anything closer to zero as little or no relationship. The cut-offs vary between textbooks and fields, so treat them as a rough guide rather than a standard.
Which currency pairs are positively or negatively correlated?
Pairs that share the same quote currency and have related base currencies, such as EUR/USD and GBP/USD, have tended to move in the same direction. Pairs where the US dollar sits on opposite sides, such as EUR/USD and USD/CHF, have tended to move in opposite directions. The strength of these relationships changes over time, so measure them on recent data before relying on them.
What does R² mean in correlation?
R² is the correlation squared. It is the share of the variation in one series that lines up with the variation in the other. A correlation of 0.60 gives an R² of 35.7%, so most of each stock's day-to-day movement is still its own.

Related calculators

All calculators →

Get price history for real companies

All stocks →

Every PromtFinance stock page has an interactive price chart and recent closing prices you can use as inputs here.

This calculator is for education and planning. It uses the formulas described above and the inputs you provide; real results depend on fees, taxes, timing and other details that a general tool cannot know. PromtFinance does not give personal financial advice. Check important decisions with your provider or a qualified professional.