Pearson Correlation Coefficient Calculator
Compute Pearson's r using r = Cov / (σX · σY). Solve for r, covariance, or either standard deviation. Includes step-by-step math, a live scatter plot schematic with the best-fit line, and companion metrics including R², significance test, confidence interval, and strength interpretation.
r is normalized covariance
Pearson's r is simply the covariance rescaled by the product of the two standard deviations. This normalization makes r a unit-free quantity bounded between −1 and +1. By Cauchy-Schwarz, |Cov| ≤ σX · σY always, so |r| ≤ 1. When |r| = 1, the two variables have a perfect linear relationship — every point lies exactly on a straight line. When r = 0, there is no linear association. Values in between describe degrees of linear strength.
r is scale-invariant
Changing the units of X or Y does not change Pearson's r. If you multiply every x by 100 (converting meters to centimeters, say), both Cov and σX get multiplied by 100, but their ratio stays the same. This makes r ideal for comparing strengths of linear relationships across datasets with different units or scales — unlike covariance, whose magnitude is only meaningful within its original context. This invariance is why correlation is the preferred measure of linear association in practice.
r equals slope of standardized regression
If you standardize both X and Y (subtract the mean, divide by the standard deviation), then the OLS regression slope of standardized Y on standardized X equals r. This is why r is often called the "standardized slope." The unstandardized slope is b = r · (σY / σX), and R² = r² tells you the fraction of variance in Y explained by X. These relationships make r fundamental to regression analysis — the same number answers "how correlated?" and "how much does Y change per unit change in X (after standardization)?"
r measures only linear association
Pearson's r captures only the linear component of a relationship. If X and Y follow a perfect U-shape (Y = X²), r could be near zero even though Y is completely determined by X. Similarly, r is sensitive to outliers — a single extreme point can push r from 0.1 to 0.9 or vice versa. And r says nothing about causation: a high |r| between two variables means they covary linearly, not that one causes the other. Always inspect a scatter plot before trusting r, and use Spearman's ρ or Kendall's τ when the relationship may be monotonic but nonlinear.
How to Use This Calculator
Pearson's correlation formula links covariance and the two standard deviations. Pick what you want to compute, and the calculator solves for the remaining quantity.
1. Choose what to solve for
Pick r, Cov, or σX from the toggle. The calculator rearranges r = Cov / (σX · σY) for whichever variable you choose.
2. Use realistic presets
Presets cover covariance from −50 to 100 and standard deviations from 1 to 100. The default (Cov = 40, σX = 20, σY = 20) gives r = 0.10, a weak positive correlation.
3. Match units consistently
Cov has units of X·Y, σX has units of X, σY has units of Y. The units cancel in the ratio, producing a dimensionless r. No unit conversion is needed as long as the values are internally consistent.
4. Read the result and verdict
The result card shows r with a sign and magnitude. A colour-coded verdict classifies strength from negligible (|r| below 0.1) through weak, moderate, strong, and very strong, in either direction.
5. Check the schematic and chart
The schematic shows four reference scatter plots (−1, −0.5, 0, +1) plus a live scatter of the current correlation. The chart plots r vs. Cov at fixed standard deviations.
6. Switch to Advanced for depth
Advanced mode adds a detailed scatter plot with the current best-fit line, a sensitivity check, and companion metrics including R², the OLS slope, the t-statistic for significance, and the 95% confidence interval.
What This Tool Offers
Built around the standard Pearson correlation formula r = Cov / (σX · σY), the most widely used measure of linear association between two variables.
Three-way solving
Solve for correlation, covariance, or standard deviation of X. The calculator rearranges the formula for whichever variable you choose.
Reference scatter panels
Four reference scatter plots showing perfect negative, moderate negative, no correlation, and perfect positive, plus a live panel with the current best-fit line.
Correlation verdict
Each result is classified from negligible (|r| below 0.1) through weak, moderate, strong, and very strong, with direction (positive/negative).
Companion correlation metrics
Coefficient of determination R², OLS regression slope, t-statistic for significance, degrees of freedom, and the 95% confidence interval.
Dual comparison charts
Correlation vs. covariance at fixed standard deviations, plus an advanced live scatter plot with the current best-fit line.
Reference tables
Correlation strength thresholds, comparison with Spearman and Kendall, and typical correlations by field.
Reference Tables & Conversions
Correlation strength thresholds, comparison with related coefficients, and typical values by field.
Correlation strength thresholds
Comparison of Correlation Coefficients
Pearson's r is one of several correlation measures. Different coefficients suit different data characteristics.
| Coefficient | Symbol | Measures | Range | Best for |
|---|---|---|---|---|
| Pearson | r | Linear association | −1 to +1 | Continuous, roughly linear data |
| Spearman | ρs | Monotonic association (ranks) | −1 to +1 | Ordinal data, nonlinear monotonic |
| Kendall | τ | Concordance of pairs | −1 to +1 | Small samples, many ties |
| Point-biserial | rpb | Continuous vs. binary | −1 to +1 | One dichotomous variable |
| Phi coefficient | φ | Association between two binaries | −1 to +1 | 2×2 contingency tables |
| Cramér's V | V | Association (any categories) | 0 to 1 | Larger contingency tables |
Typical Pearson Correlations by Field
Representative strengths of linear association in various domains. Effect sizes vary widely — always interpret in context.
| Relationship | Typical r | Strength | Notes |
|---|
Variable Reference
| Symbol | Meaning | Typical range | Notes |
|---|---|---|---|
| r | Pearson correlation coefficient | −1 to +1 | Dimensionless, scale-invariant |
| Cov | Covariance | Any real | Depends on units of X and Y |
| σX | Standard deviation of X | > 0 | Same units as X |
| σY | Standard deviation of Y | > 0 | Same units as Y |
| R² | Coefficient of determination | 0 to 1 | r², fraction of variance explained |
| n | Sample size | ≥ 3 | Needed for inference (t-test, CI) |
| t | Test statistic for r | any real | t = r√(n−2) / √(1−r²) |
What Does r = Cov / (σX · σY) Measure?
Pearson's correlation coefficient r measures the strength and direction of the linear relationship between two continuous variables. By normalizing covariance by the product of the two standard deviations, r produces a unit-free measure bounded between −1 and +1 — a value of +1 means the two variables lie exactly on an upward-sloping line, −1 means an exactly downward-sloping line, and 0 means no linear association. Because of its scale invariance and interpretability, r is the most widely reported measure of linear association across the physical, biological, and social sciences.
Pearson Correlation Formula
The defining relationship is:
Expanded in terms of raw data:
Rearranged to solve for the other two quantities:
σX = Cov / (r · σY)
The coefficient of determination is r squared:
For inference about r, the test statistic is:
Pearson Correlation Variables
| Symbol | Meaning | Notes |
|---|---|---|
| r | Pearson correlation coefficient | Unit-free; ranges from −1 to +1 |
| Cov | Covariance between X and Y | Depends on units of X and Y |
| σX | Standard deviation of X | Must be > 0 |
| σY | Standard deviation of Y | Must be > 0 |
| R² | Coefficient of determination | Fraction of Y's variance explained by X |
| n | Sample size | Used for significance testing |
How Each Variable Affects Correlation
Pearson's r increases linearly with covariance and decreases inversely with each standard deviation. Doubling the covariance doubles r (as long as |r| ≤ 1); doubling σX or σY halves r. This ratio relationship is what makes r scale-invariant: if you change the units of X (multiplying both Cov and σX by the same factor), the ratio stays the same. This is why you can compare the strength of a relationship between income and happiness with the strength of a relationship between height and weight, even though the units are completely different.
The value of r is bounded by Cauchy-Schwarz: |Cov| ≤ σX · σY, so |r| ≤ 1 always. Equality occurs only when one variable is a perfect linear function of the other (Y = a + bX for some constants a and b). The sign of r matches the sign of the slope b: positive r means Y tends to increase with X, negative r means Y tends to decrease with X. Values near zero indicate weak or no linear association — but as noted above, r = 0 does not rule out a strong nonlinear relationship.
Pearson Correlation Calculation Examples
r = 40 / (20 × 20) = 40 / 400 = 0.10 (weak positive)
Cov = 0.75 × 10 × 5 = 37.5
σX = 90 / (0.60 × 15) = 90 / 9 = 10
t = 0.80 × √(30 − 2) / √(1 − 0.64) = 0.80 × √28 / √0.36
t = 0.80 × 5.29 / 0.60 = 7.05 (df = 28)
Highly significant (p < 0.001)
Frequently Asked Questions
Covariance measures how two variables vary together, but its magnitude depends on the units of both variables. Change X from meters to centimeters and covariance increases by 100×, with no change in the actual relationship. Pearson's correlation r normalizes covariance by the product of the two standard deviations: r = Cov / (σX · σY). This produces a unit-free number between −1 and +1 whose magnitude has a consistent interpretation: ±1 is perfect linear association, 0 is no linear association. When you want to compare the strength of a linear relationship across different datasets or variables, use correlation. When you need to preserve scale for downstream calculations (like regression slopes or portfolio variance), covariance is the right tool.
r = 0 means there is no linear association between the two variables — knowing X tells you nothing about Y in a linear sense. However, r = 0 does not mean the variables are unrelated. They could have a strong nonlinear relationship (e.g., Y = X² gives r = 0 for symmetric X) or a non-monotonic relationship (e.g., a U-shape). Always plot the data before concluding the variables are independent. Additionally, r = 0 does not mean the variables are statistically independent — independence is stronger than zero correlation. Two variables can be dependent with r = 0, but if they are independent, r must be 0.
It depends entirely on context. In physics, correlations above 0.99 are common for well-controlled measurements. In psychology and social science, correlations of 0.3–0.5 are considered meaningful; 0.5–0.7 is strong. In medicine, even 0.2 between a biomarker and disease risk can be clinically important at population scale. In finance, correlations between 0.3 and 0.7 between asset returns are typical. A useful guideline (Cohen's conventions): |r| < 0.1 negligible, 0.1–0.3 weak, 0.3–0.5 moderate, 0.5–0.7 strong, > 0.7 very strong. But these thresholds are conventions, not laws — always interpret r alongside the scatter plot, sample size, and domain knowledge.
No. Correlation measures statistical association, not causal effect. A high |r| between X and Y could mean X causes Y, Y causes X, or a third variable Z causes both. Classic example: ice cream sales and drowning deaths are positively correlated because both are driven by warm weather — but ice cream doesn't cause drowning. Establishing causation requires experimental design (randomized controlled trials), instrumental variables, natural experiments, or other causal-inference methods. Pearson's r alone is a descriptive statistic, not evidence of causation. The famous phrase "correlation does not imply causation" is one of the most important caveats in all of statistics.
Small sample sizes produce unstable r estimates with wide confidence intervals. A correlation of 0.30 based on n = 5 is not significantly different from zero, whereas the same r = 0.30 with n = 100 is highly significant (p < 0.01). The t-statistic for testing r = 0 is t = r·√(n−2)/√(1−r²), with df = n − 2. For r = 0.30 and n = 5, t = 0.55 (p ≈ 0.62). For r = 0.30 and n = 100, t = 3.08 (p ≈ 0.003). Always report both r and n (or the confidence interval), never r alone. A very high r from a tiny sample should not be treated as reliable evidence of a strong association.
Spearman's ρ (rho) is a rank-based correlation that measures monotonic association — whether Y tends to increase as X increases (not necessarily linearly). Use Spearman's ρ when: (1) the relationship is monotonic but nonlinear (e.g., logarithmic); (2) the data are ordinal (ranks, categories with order); (3) the data contain outliers that could distort Pearson's r; (4) the distributions are heavily skewed; (5) both variables are continuous but you want a robust measure. For roughly linear relationships with no strong outliers, Pearson's r and Spearman's ρ give similar answers. When they disagree substantially, it usually means the relationship is monotonic but nonlinear, and Spearman's ρ is more appropriate.
R² (the coefficient of determination) is simply r squared. It represents the fraction of variance in Y that is explained by the linear relationship with X. For example, r = 0.80 gives R² = 0.64, meaning 64% of the variance in Y is explained by X, and 36% is unexplained. Note that R² is always between 0 and 1 (because r² is), so it loses the sign information — a strong negative correlation and a strong positive correlation give the same R². When interpreting, remember that "explained variance" is a statistical decomposition, not a causal claim. Even a high R² can arise from confounding, and low R² does not necessarily mean a weak relationship if the relationship is nonlinear.
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| r | Pearson correlation coefficient | |
| Cov(X,Y) | Covariance of X and Y | |
| σX | Standard deviation of X | |
| σY | Standard deviation of Y |
What it means
The Pearson correlation coefficient (r) is a standardised measure of the strength and direction of the linear relationship between two variables. It ranges from −1 (perfect negative linear) to +1 (perfect positive linear), with 0 indicating no linear correlation. It is the covariance divided by the product of the standard deviations. Correlation is widely used in data analysis, in finance (diversification), in medicine (association between risk factors), and in psychology. However, correlation does not imply causation. It is also sensitive to outliers. Understanding r is crucial for interpreting scatterplots and for building regression models. The square of r, R², represents the proportion of variance explained.
Worked example
Pearson Correlation – Two Examples
Real‑World| Parameter | Value |
|---|---|
| Cov | 15 |
| σX | 5 |
| σY | 4 |
| Parameter | Value |
|---|---|
| Cov | -10 |
| σX | 3 |
| σY | 4 |
Common mistakes
- Correlation coefficient r: Measures the strength and direction of a linear relationship.
- Range: r is between −1 and +1 inclusive.
- Units: r is dimensionless.
- Causation: Correlation does not imply causation.
- Outliers: Outliers can greatly affect the correlation coefficient.
Applications
The Pearson correlation coefficient (r) measures the strength and direction of a linear relationship between two variables, ranging from −1 to +1. It is one of the most used statistics in all disciplines. Engineers use it to validate simulation models, to assess relationships between input and output variables, and to design experiments. In finance, it diversifies portfolios. In medicine, it correlates risk factors with outcomes. By calculating r, professionals can quantify the degree of association, test hypotheses about relationships, and identify redundant predictors. The correlation coefficient is scale‑independent, making it interpretable across different units. It is a cornerstone of exploratory data analysis and predictive modelling.
- Exploratory data analysis – identifying variable relationships
- Model validation – comparing simulated and measured data
- Finance – diversification and asset correlation
- Medical research – linking risk factors to diseases
- Quality control – process input‑output correlation
Related calculators · Descriptive Statistics
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.