Interactive module guide

Pearson Correlation Calculator — Test & CI

This Pearson correlation calculator tests whether a linear association differs from zero and reports a Fisher-z confidence interval and r².

Open calculator

Free · No sign-up · Calculations stay in your browser

The Pearson correlation test asks whether the linear association between two paired numeric variables differs from zero in the population.

The sample correlation r is referred to an exact t distribution through t = r·√((n−2)/(1−r²)) with n − 2 degrees of freedom, and the confidence interval for the population correlation ρ uses the Fisher z transform.

This calculator reports r, the t statistic, the p-value for two-sided or directional alternatives, the Fisher-z interval, and r²—the share of variance in either variable that a linear relationship with the other would account for.

Use the Pearson correlation calculator for paired numeric variables when the linear relationship is the question; inspect a scatter plot first, because one influential pair can dominate r.

When to use this Pearson correlation calculator

Use it when

  • Use it when both variables are numeric, pairs are independent, and the scientific question is specifically about a linear relationship: dose and response, spend and sign-ups, one instrument against another.
  • Use it when you need an interval, not only a verdict. The Fisher-z interval describes which population correlations are compatible with the data, which is almost always more informative than the bare rejection of ρ = 0.
  • Use it before fitting a regression as a compact screen: r² previews how much a straight line could explain, and a weak r with a strong visible pattern warns that the relationship is nonlinear before any modeling begins.

Choose another method when

  • Avoid it when a scatter plot shows curvature: a monotone but curved association deflates r even when the relationship is nearly deterministic, and the Spearman rank version represents such data more faithfully.
  • Avoid it when single extreme pairs dominate. One influential outlier can manufacture or destroy a large r; rank-based alternatives bound each observation’s influence.
  • Avoid causal language entirely: a nonzero correlation is compatible with confounding, selection effects, and reverse causation, and no p-value or interval distinguishes among them.

Interactive tool

The calculator loads as you approach this section so the guide remains fast on mobile connections.

Example preview

Fourteen paired numeric readings

Inputs
Fourteen (x, y) pairs; two-sided test of ρ=0 at α=0.05.
Representative result
r≈0.9907 with t(12)≈25.3 and p≈9×10⁻¹²; the 95% Fisher-z interval spans ≈ [0.970, 0.997].

Illustrative only. Load the interactive tool to enter your own values and review assumptions.

Watch the explanation

4:58 min

The player loads only after you press play. You can also watch on YouTube.

Read the complete transcript

The Pearson Correlation Test. Two numeric variables can move together, yet the shape of that movement matters. Pearson correlation measures how tightly paired observations follow one straight-line direction. Pairing is part of the data. Entry i in X must belong to entry i in Y, and the two fields must have equal lengths. Plot every pair before calculating. A straight rising cloud supports positive r, a falling cloud supports negative r, while curvature and clusters demand caution. Center both variables at their sample means. Multiply each X deviation by its matched Y deviation, then sum those cross-products to capture shared direction. Normalize that cross-product sum by the square root of both centered square sums. The resulting r stays between minus one and one and has no units. For inference, transform r to t using n minus two degrees of freedom. Stronger absolute correlation moves farther from the zero-correlation center. The selected tail states the alternative in advance. Two-tailed means nonzero, right-tailed means positive, and left-tailed means negative population correlation.

The exact t reference requires independent pairs and approximate bivariate normality. The calculator performs the arithmetic, but it cannot verify either design condition. Linearity is an interpretation condition. A perfectly ordered curve may have r below one, and a U-shaped relationship may produce r near zero. One influential pair can manufacture or erase a large coefficient. Inspect the point cloud and investigate leverage before treating r as a stable summary. Pooled clusters can also mislead. A strong overall line may disappear inside each subgroup, so preserve known groups and avoid an ecological shortcut. With more than three pairs, Fisher's z transform builds the confidence interval using standard error one over square root of n minus three. Transforming that z interval back makes it asymmetric around r, especially near minus or plus one. With exactly three pairs, this page shows no interval. The page also reports r squared, a simple linear association summary. It is not a causal fraction, regression slope, adjusted effect, or prediction guarantee.

Now follow fourteen paired readings with a two-sided alpha of point zero five. The scatter plot forms a narrow rising band without a lone remote point. The sample means are three point five for X and five point five seven nine for Y. Keep every centered deviation attached to its original partner. The centered cross-product sum is twenty-three point five. The X and Y centered square sums are eighteen point eight four and twenty-nine point eight six four. Divide twenty-three point five by the square root of those two square sums. Pearson r is zero point nine nine zero seven, a very strong positive linear association. The t transform gives twenty-five point two six eight with twelve degrees of freedom, far beyond the two-sided critical magnitude of two point one seven nine. The two-sided p-value is about eight point nine six times ten to the minus twelve. Reject zero population linear correlation at alpha point zero five. The ninety-five percent Fisher interval runs from zero point nine seven zero one to zero point nine nine seven one, and r squared is zero point nine eight one six.

Negate Y and r becomes negative zero point nine nine zero seven. The two-sided p-value stays fixed, while the left and right one-sided probabilities swap. Shift Y by three and multiply it by positive two. Every Pearson result stays unchanged because origin and positive measurement units cancel during normalization. For X from one through seven and Y equal to X squared, Spearman rank correlation is one but Pearson r is only zero point nine seven seven four. Seven balanced points can give r equal to zero. Add one remote pair at ten, ten, and r jumps to zero point eight three seven with p below point zero one. Validation stops unequal lengths, fewer than three pairs, a constant column, or invalid alpha. Three valid pairs permit a test but not the Fisher interval. Report the pairing design, scatter shape, n, r, t, degrees of freedom, chosen tail, p, alpha, Fisher interval, r squared, and influential-point checks. Use Spearman for monotone curvature, Kendall for ordinal concordance, and regression for slopes or prediction. Run the Pearson Correlation Test free at Distri Scope dot com.

How to read the result

Read the interval first: an interval hugging zero says any linear association is weak regardless of the p-value, while a significant p with a wide interval mostly reflects small n.

The sign of r carries the direction; the magnitude interpretation bands (negligible below 0.1 up to very strong above 0.7) are conventions, and subject-matter scale matters more than the labels.

A large r with visibly curved data is a warning, not a success: linearity is an assumption of the interpretation, and the calculator cannot see the scatter plot for you.

How to use the Pearson correlation calculator

Enter the two variables in matching order with equal lengths; the i-th values of both fields must come from the same unit. At least 3 pairs are required, and the interval needs at least 4.

The tail choice refers to the sign of the correlation: right-tailed tests ρ > 0, left-tailed ρ < 0.

Constant input in either variable makes correlation undefined and returns an explicit error rather than a fake zero.

Formula, hypotheses, and assumptions

t=rn21r2t = r\sqrt{\frac{n-2}{1-r^2}}

Conditions to review

  • Paired observations from one population of pairs
  • A linear relationship is the quantity of interest
  • Approximate bivariate normality for the exact t reference
  • No influential outliers dominating the covariance

Calculator parameters

  • Significance Level (α): default 0.05.
  • Test Type: default Two-tailed.

What the method is doing

The p-value uses the exact t reference for bivariate normal data—the same convention as scipy’s pearsonr—so results are directly reproducible.

The confidence interval transforms r with Fisher’s z = atanh(r), builds a normal interval with standard error 1/√(n−3), and transforms back; it is asymmetric around r whenever r is far from zero, which is correct behavior, not an error.

r² is reported alongside r because readers routinely overestimate the strength implied by a given r; r = 0.5 explains only a quarter of the variance.

Worked example: fourteen paired readings

Fourteen units are measured on two numeric variables. X: 2.1, 3.4, 1.8, 5.6, 4.2, 3.9, 2.7, 4.8, 3.1, 5.0, 2.4, 4.5, 3.4, 2.1. Y: 4.0, 5.2, 3.5, 8.1, 6.3, 6.0, 4.4, 7.2, 5.5, 7.8, 4.1, 6.9, 5.2, 3.9. Test whether the population linear correlation differs from zero at α = 0.05.

  1. 1Compute the sample correlation from the centered cross-products: r ≈ 0.9907, so the points sit almost exactly on a rising line.
  2. 2Convert to the t scale: t = 0.9907·√(12/(1 − 0.9907²)) ≈ 25.3 with 12 degrees of freedom.
  3. 3The two-sided p-value is about 9×10⁻¹², far below α = 0.05, so the null hypothesis ρ = 0 is rejected.
  4. 4The 95% Fisher-z interval runs from about 0.970 to 0.997, and r² ≈ 0.98: a linear relationship accounts for essentially all of the variance in these fourteen pairs.

Interpretation

The data are practically collinear: the interval keeps every plausible population correlation above 0.97. With an association this strong the p-value is a formality; the substantive work is checking that the pairing is genuine, the units are independent, and no shared driver trivially explains both variables before any real-world claim is made.

Common mistakes

  • Do not read correlation as causation; the test quantifies co-movement in one sample of pairs and nothing more.
  • Do not pool data across subgroups without checking for mixture effects: two clusters with zero internal correlation can produce a large pooled r (and the reverse), the classic ecological trap.
  • Do not screen many variable pairs and report the best r at face value; multiplicity inflates the best-looking correlation and its significance.

Limits and independent validation

The exact t reference assumes approximate bivariate normality; with heavy tails the p-value is only approximate, and the rank alternatives are safer.

The Fisher interval’s coverage is approximate in small samples; below roughly ten pairs treat the interval as indicative.

No regression output is provided—slope, intercept, and prediction intervals are a different analysis with additional assumptions.

Before using the result

  • Plot the pairs before trusting any number from this page: linearity, outliers, and clusters are all visible in seconds and invisible in r.
  • Recompute r on a subset by hand or in a spreadsheet to confirm data entry, and confirm the pairing order between the two fields.
  • Cross-check with the Spearman version: close agreement supports a genuinely linear reading, and a large gap flags curvature or outliers as the driver.

See every option in the Statistical Hypothesis Test Calculator or review the DistriScope methodology. Educational information; last reviewed 2026-08-09. Verify consequential calculations independently.