Stock Correlation Calculator

Do your holdings really diversify each other? Enter up to six stocks or ETFs to get a color-coded correlation matrix from weekly or monthly returns, the average correlation, the most and least related pairs, and the volatility and return of each. Free, and you can add it to your own website.

Free · no sign-up · updated

How to use the calculator

  1. Enter 2 to 6 tickers separated by commas, such as SPY, QQQ, TLT, GLD, VNQ, and press Calculate or Enter.
  2. Pick the period, from 1 to 10 years, and weekly or monthly returns.
  3. Read the matrix: dark blue cells move together, pale cells are unrelated, orange cells move in opposite directions.

What correlation measures

Correlation measures how consistently two investments move in the same direction, on a scale from −1 to +1. At +1 they always rise and fall together; at 0 their moves are unrelated; at −1 one rises whenever the other falls. The calculator uses the Pearson correlation of total returns (dividends reinvested), on the weeks or months when all the tickers traded.

correlation(A, B) = covariance(A, B) / (standard deviation A × standard deviation B)

Correlation says nothing about the size of the moves. Two stocks can be highly correlated while one moves twice as much as the other; that is what beta measures.

Correlation and diversification

Combining investments that are not perfectly correlated lowers the swings of a portfolio without lowering its expected return as much. That is the core of diversification. Stocks in the same industry are usually highly correlated (often 0.6 to 0.9), so owning ten bank stocks diversifies less than it seems. Broad stock funds, government bonds, gold and real estate have historically had lower correlations with each other.

  • Average correlation above about 0.7 means the holdings tend to move as one.
  • Below about 0.3 they diversify each other well.
  • Correlations are not constant. They often rise in sell-offs, just when diversification is needed most, and stocks and bonds have moved together in some years, such as 2022.

Weekly or monthly?

Weekly returns give more data points over a short period, so the figures are more stable over 1 to 3 years. Monthly returns smooth out short-term noise and suit longer periods. If a ticker has a shorter history, the calculator uses only the common dates and says so.

To test how a mix of these holdings would have done, use the portfolio backtest calculator, and keep the mix on target with the rebalancing calculator.

Frequently asked questions

What is stock correlation?

A number from −1 to +1 that measures how consistently two investments move in the same direction. +1 means always together, 0 unrelated, −1 always opposite.

How is the correlation calculated?

From the weekly or monthly total returns of each pair over the chosen period, using the Pearson formula: covariance divided by the product of the two standard deviations.

What is a good correlation for diversification?

Lower is better for diversification. Pairs below about 0.3 diversify well; above about 0.7 they tend to move as one.

Why are stocks and bonds sometimes positively correlated?

When inflation and interest rates move sharply, both stocks and bonds can fall together, as in 2022. In other periods, such as recessions with falling rates, bonds have tended to rise when stocks fall.

How many tickers can I compare?

Two to six. The matrix shows every pair.

Why does the period start later than I chose?

The calculator uses only dates that all the tickers share. If one has a shorter history, the period starts when it began trading.

Can I put this calculator on my website?

Yes. It is free for any site. Use the embed code generator at the bottom of this page and keep the credit line under the calculator.

Related calculators

See all free investing calculators, or add live stock quotes to your site with the free stock widgets.

Add this calculator to your website

The calculator is free to embed on any website, personal or commercial, and works on WordPress, Blogger, Wix, Squarespace, Webflow, Ghost and plain HTML. Choose the options, copy the code and paste it into your page.

Layout
Theme

Preview: this is how the calculator and the credit line will look on your page

Free for personal and commercial websites. Please keep the “by Quotelinks” credit line under the calculator visible and unchanged, and don’t modify the calculator or present it as your own. The <script> line is optional: it sizes the frame to fit the calculator; if your platform removes scripts, the calculator still works at the fixed height. Past returns and past risk don’t predict the future. Results are for illustration only, not financial advice.