Deepnote is now open-source! Star us on GitHub ⭐️
Get started
← Back to all data apps

Correlation coefficient calculator

By Srihari Thyagarajan

Updated on February 27, 2026

Use this correlation calculator to measure the strength and direction of co-movement between two variables. Supports Pearson, Spearman, and Kendall methods for both linear and rank-based relationships.

Use template ->

What is correlation?

Correlation is a statistical measure of how closely two variables move together. A positive correlation means they tend to increase and decrease in the same direction; a negative correlation means they move in opposite directions. The strength of the relationship is expressed as a coefficient between −1 and 1, where values near the extremes indicate strong relationships and values near 0 indicate weak or no linear association.

The three standard methods capture different types of relationships. Pearson assumes a linear relationship and is sensitive to outliers. Spearman and Kendall operate on ranks, making them more appropriate when data has outliers, non-normal distributions, or monotonic but non-linear relationships.

Correlation formula

Pearson: r = Σ[(xi − x̄)(yi − ȳ)] / √[Σ(xi − x̄)² × Σ(yi − ȳ)²]

Where r is the Pearson correlation coefficient, xi and yi are paired observations for each data point, and x̄ and ȳ are the respective sample means of each variable. The numerator captures how much the two variables deviate from their means in the same direction; the denominator normalises by their individual spreads so the result always falls between −1 and 1.

Spearman applies the same formula to rank-transformed values. Kendall uses a different approach based on the concordance and discordance of pairs, which makes it more interpretable as a probability but computationally heavier.

How the correlation calculator works

All three methods run on the same dataset so comparison is direct. A scatter plot accompanies the coefficients because the visual pattern is integral to interpretation. A high coefficient alongside visible nonlinearity in the scatter deserves caution rather than confidence in the linear reading.

Running the same data through multiple methods and checking whether conclusions stay consistent is more reliable than anchoring on a single coefficient. When methods agree, the relationship is more robust. When they diverge, it usually points to outliers or a non-linear structure worth examining.

How correlation is used in practice

Correlation is used in finance for portfolio construction and risk analysis, where understanding co-movement between assets matters for diversification. In analytics and research, it is a standard first step when exploring whether two variables are worth modeling together. In business settings, it appears frequently in exploratory analysis before any predictive modeling begins.

Srihari Thyagarajan

Technical Writer

Follow Srihari on Twitter, LinkedIn and GitHub

Try Deepnote now

Get started – it’s free
Book a demo

Footer

Solutions

  • Notebook
  • Data apps
  • Machine learning
  • Data teams

Product

Company

Comparisons

Resources

Footer

  • Privacy
  • Terms

© 2025 Deepnote. All rights reserved.