Stock Correlation Calculator
Measure how closely two stocks move together on a −1 to +1 scale, or map an entire portfolio, to see where you're doubling up instead of diversifying.
Why it matters: Owning ten stocks that all move together isn't diversification — it's one bet in ten disguises. Correlation shows which of your holdings are really the same position, so a single bad day doesn't hit everything at once.
Stock correlation measures how closely two stocks move together, on a scale from −1 to +1. A correlation above roughly 0.7 means you are largely holding the same bet twice, so it adds little diversification. Owning many stocks is not the same as being diversified — what matters is how independently they move.
Example calculation
Say you have four months of returns for two stocks. Stock A returned 1%, 2%, 3%, 4% and Stock B returned 2%, 1%, 4%, 3%. Both average 2.5%.
Running Pearson correlation on those return pairs gives r = 0.60 — a moderate positive relationship. They lean the same way, but not in lockstep, so holding both still spreads some risk. Notice we correlated the returns, not the prices: that is the part most people get wrong.
How to calculate correlation between two stocks
Stock correlation is measured with the Pearson correlation coefficient applied to the two stocks' returns — the percentage change from one period to the next — not to their raw prices. The formula divides how the two return series move together (their covariance) by how much each one moves on its own (their standard deviations):
Σ (aᵢ − ā)(bᵢ − b̄)
r = ────────────────────────────────
√[ Σ(aᵢ − ā)² · Σ(bᵢ − b̄)² ]
aᵢ, bᵢ = the two stocks' returns in period i
ā, b̄ = their average returns
r = a number from −1 to +1Work the example from the box above. Stock A returns are 1%, 2%, 3%, 4% and Stock B are 2%, 1%, 4%, 3%; both average 2.5%. The deviations from the mean multiply out to 0.75 each period, so the top of the fraction sums to 3.0. Each series' squared deviations sum to 5.0, so the bottom is √(5 × 5) = 5. That gives r = 3.0 ÷ 5 = 0.60. The calculator above does this for any data you paste, and also reports R², covariance, and each stock's standard deviation.
One rule matters more than the arithmetic: correlate returns, never price levels. Two stocks that both drift upward over the years will show a correlation near 0.99 on their prices simply because both lines slope up — even if their week-to-week moves are unrelated. Converting to returns first strips out that shared trend and measures how the holdings actually co-move.
What is a good correlation for diversification?
For diversification you want low or negative correlation — roughly below 0.3, and ideally near zero or below it. Two holdings correlated above about 0.7 barely diversify each other: when one drops, the other almost always drops too, so you are carrying the same risk twice. There is no single "correct" number, because it depends on your goals and the rest of your portfolio, but the lower the correlations among your holdings, the smoother the combined ride tends to be. This is the same worry our ETF overlap checker answers from a different angle — see the note below on how the two tools differ.
Correlation vs covariance: what the difference actually means
Covariance and correlation both measure whether two return series move together, but covariance is in raw, unbounded units, while correlation is covariance standardized onto a fixed −1 to +1 scale. Covariance answers "do they move together, and in what direction?" but its size depends on how volatile each stock is, so you cannot compare one covariance to another. Correlation divides covariance by the two standard deviations, cancelling out the units, so a 0.8 is a 0.8 whether you are comparing penny stocks or blue chips. That is why correlation, not covariance, is the number you use to judge diversification.
Why correlation between stocks rises during market crashes
In a panic, correlations jump toward +1 — the diversification you counted on tends to vanish exactly when you need it. When investors sell in fear, they sell almost everything at once: quality and junk, tech and energy, the stock you love and the one you tolerate. Prices then move on one factor — the rush for the exit — rather than on each company's own story, so holdings that normally drift apart suddenly fall together. It is a core reason to treat any correlation as a fair-weather estimate, and to pair low-correlation stocks with genuinely different assets (such as bonds) that behave differently under stress.
Correlation is not causation — and why that matters for portfolios
A high correlation tells you two stocks have moved together; it does not tell you why, and it certainly does not mean one drives the other. Two names can be strongly correlated because they share a hidden common cause — the same sector, the same interest-rate sensitivity, the same handful of index funds buying them — or by pure coincidence over a short window. For a portfolio, the practical takeaway is humility: do not build a strategy on a correlation you cannot explain, and do not assume a relationship that held last year will hold next year. Correlation is a description of the past, not a mechanism you can lean on.
How correlation relates to portfolio risk and volatility
Correlation is the lever that decides how much combining holdings actually reduces risk. A portfolio's volatility is not just the average of its parts' volatilities — it also depends on how those parts move together. Blend two equally volatile stocks with a correlation of +1 and the combination is just as volatile as either one; drop the correlation to 0 and the swings partly cancel, so the blend is meaningfully calmer; make it negative and they offset even more. That is the entire mathematical basis of diversification, and it is why measuring correlation is worth the trouble. Once you know a mix behaves, our investment goal calculator can help you size contributions toward a target.
Negative correlation: which asset pairs actually deliver it
Reliable negative correlation is rare between two individual stocks — most equities share enough common risk to stay positive. It shows up more dependably across asset classes: long-term Treasury bonds have often (though not always) moved opposite to stocks, which is why a classic stock-and-bond mix cushions drawdowns. Other sometimes-negative relationships include defensive sectors versus high-beta growth, or certain safe-haven assets during risk-off periods. Two cautions: these relationships drift and can flip (stocks and bonds fell together in 2022), and a negatively correlated holding usually drags on returns during a long bull market — the cost of the insurance.
Why two different ETFs can have 0.99 correlation
Two ETFs with different names, tickers, and providers can still be 99% correlated because they hold the same underlying companies. An S&P 500 fund and a total-market fund are both dominated by the same mega-caps, so their returns are nearly identical period to period. Correlation and overlap are two lenses on that one problem: correlation looks at shared price behaviour, while our ETF overlap checker looks at shared holdings. High overlap almost guarantees high correlation, but two funds can also be highly correlated without obvious overlap when they track the same factor or sector. Running both tools tells you not just that two funds move together but why.
How many stocks do you need to be diversified?
Research on diversification suggests most of the company-specific risk is gone by around 20 to 30 stocks — but only if those stocks are not all the same kind of bet. Twenty tech names that move together are far less diversified than ten holdings spread across sectors, sizes, and asset classes. Adding a 40th stock that is highly correlated with the 39 you already own barely changes your risk. That is the point this calculator makes concrete: the number of holdings matters much less than the correlations between them.
Daily vs weekly vs monthly returns: which period to use and why the answer changes
The return period you choose can change the correlation you get, so pick it deliberately. Daily returns give you the most data points but capture short-term noise and are sensitive to non-synchronous timing. Weekly and monthly returns are smoother and better reflect how a long-term investor actually experiences a holding, at the cost of fewer observations. A common choice is weekly or monthly returns over one to three years. Whatever you pick, use the same period for both series, and remember that a longer, calmer window will usually report lower correlations than a short, turbulent one.
How to get price data for this tool with Google Sheets
This tool does not fetch prices — you bring your own data, which is what keeps it free, private, and free of data-licensing limits. The easiest source is Google Sheets, and the calculator has a built-in “Get price data with Google Sheets” helper: type your tickers and it writes a ready formula for each one. Here is the whole flow:
- In the helper, enter your tickers and click Copy formulas & open Google Sheets. It copies one formula per stock and opens a blank sheet.
- Click cell
A1in that sheet and paste once. Each stock gets its own column of closing prices, headed by its ticker. (Under the hood each is an=INDEX(GOOGLEFINANCE("AAPL","close",TODAY()-730,TODAY(),"WEEKLY"),0,2)— theINDEX(...,0,2)keeps just the price column so the stocks line up side by side.) - Copy those price columns and paste them into the calculator, then set the toggle to Prices — it converts them to returns for you.
A couple of notes. Keep the same date range and interval for every stock so the rows line up. GOOGLEFINANCE supports daily and weekly intervals; it has no monthly option, so for a monthly view use weekly data, which works well for correlation. Other sources work too — most brokers let you export watchlist history to CSV, and free data sites let you download it — as long as you can get a column of closing prices to paste.
Because everything runs in your browser and nothing is uploaded or stored, you can paste sensitive account data without it leaving your device. When you are done here, the DCA calculator and the leveraged ETF decay calculator pick up where correlation leaves off — turning a diversified plan into a contribution schedule and stress-testing how leverage behaves over a bumpy path.
Correlation vs overlap: which "am I diversified?" tool to use
Correlation and overlap answer the same underlying worry — am I actually diversified? — from two angles. Overlap looks at whether your funds literally hold the same stocks; correlation looks at whether your holdings move the same way, whatever they contain. Use the ETF overlap checker when you want to know if two funds are secretly the same basket, and this correlation calculator when you want to know if your positions — funds or individual stocks — rise and fall together. Together they give you the full picture: what you own, and how it behaves.
A note on accuracy and limits
Correlation is backward-looking and unstable. A coefficient measured over one window can look very different in the next, and it tends to rise during crashes, so treat every number as a description of the sample you fed in, not a forecast. For a trustworthy read, use at least 20 return observations — the calculator warns you when your sample is smaller — and prefer more history when you have it. This tool is for education only and is not investment advice.
Keep going — related calculators
Answer your next investing question in under a minute.
Am I buying the same stocks through multiple ETFs?
Get an illustrative estimate of potential ETF holdings overlap and concentration using simplified sample data.
Shared holdings • Overlap % • Combined exposure
What could investing monthly grow into?
Estimate the future value of investing a fixed amount every month over time.
Future value • Gains vs contributions
Why is my 3x ETF down when the index is flat?
See how daily compounding can make a 2x or 3x ETF differ from simply multiplying the benchmark's return.
Daily compounding • Volatility decay • 2x/3x/inverse
Am I on track to hit my investment goal?
See if you're on track for a goal and what monthly contribution it takes to get there.
On track? • Required monthly • Real value
Frequently asked questions
Educational use only — not financial advice
StockLeo is for educational purposes only and does not provide financial, investment, legal, or tax advice. Calculations are estimates and may not reflect your full tax or financial situation. Consult a qualified professional before making financial decisions.