Correlation

Pearson & Spearman Correlation Coefficient Calculator

A free calculator for the two most common correlation coefficients. Use Pearson r for linear relationships between continuous variables, Spearman rho for ranked or non-normal data. You get r, the p-value, a 95% confidence interval and a scatter plot.

Open the calculator

Run this analysis in the DeepStats analyzer. Free, no sign-up required, results appear instantly after you paste or upload data.

Open the calculator — run it in /analyze

When to use this test

  • You have two continuous (or at least ordinal) variables measured on the same cases.
  • You want to know the strength and direction of their relationship, not to predict one from the other.
  • Use Pearson r when both variables are roughly normal and you expect a straight-line relationship.
  • Use Spearman rho when variables are skewed, contain outliers or are measured on a rank scale.
  • You are screening many variables — a correlation matrix gives you a quick overview before modelling.

How to use it

  1. 1

    Upload or paste your dataset

    Load a CSV or XLSX, or paste rows into the grid. You need at least two numeric columns. Pairs with missing values on either variable are dropped automatically; a missing-value summary is shown before the calculation runs.

  2. 2

    Pick Pearson, Spearman or a correlation matrix

    Under the Correlation category choose Pearson (linear, normal data) or Spearman (ranked or non-normal data). To screen many variables at once, pick the correlation matrix option and select all numeric columns.

  3. 3

    Assign the two variables

    Drag the two columns you want to correlate into the Variable X and Variable Y slots. Order does not affect r. For the matrix version, multi-select any number of numeric columns.

  4. 4

    Read r, the p-value and the scatter plot

    DeepStats reports the coefficient, its 95% confidence interval, a p-value for the test that the true correlation is zero, and sample size. A scatter plot with an overlaid linear fit (for Pearson) makes it easy to spot non-linearity or outliers.

  5. 5

    Export the table or scatter plot

    Save the correlation matrix as CSV or the scatter plot as PNG. When you run the matrix version, cells are colour-coded so strong correlations stand out at a glance.

Example with sample data

Eight data points relating study hours to exam score. Paste into the grid and run Pearson correlation to reproduce the numbers below.

Hours,Score
1,52
2,61
3,68
4,74
5,80
6,83
7,88
8,95

The calculator returns r ≈ 0.995, 95% CI [0.973, 0.999], p < 0.001, n = 8. A near-perfect positive linear relationship — as study hours rise, scores rise almost proportionally. The scatter plot shows the fit line passing cleanly through every point, confirming Pearson is appropriate.

How to interpret the results

You will see: correlation coefficient (r or rho), 95% confidence interval, two-tailed p-value, sample size (after dropping missing pairs), scatter plot with fitted line.

The coefficient (r or rho)
Ranges from −1 to +1. Zero means no monotonic relationship. Conventional benchmarks: |r| ≈ 0.1 weak, 0.3 moderate, 0.5 strong, 0.7+ very strong. Sign indicates direction — positive means variables rise together, negative means one rises as the other falls.
95% confidence interval
A range of plausible values for the true population correlation. If the interval excludes zero, the relationship is significant at the 0.05 level. Narrow intervals indicate precise estimates; wide intervals signal you need more data.
p-value
The probability of seeing a correlation at least as large as yours if the true correlation were zero. Below 0.05 is the usual threshold. Significance alone does not say the relationship is strong — in a large sample a tiny r can be significant.
Sample size
DeepStats reports n after listwise deletion of missing pairs. The precision of any correlation estimate grows with sample size; below n ≈ 20 the confidence interval gets very wide.
Scatter plot
Always inspect the scatter plot before interpreting r. A small r can hide a strong non-linear relationship, and a large r can be driven by a single outlier. Pearson is especially vulnerable to extreme values.

Assumptions

  • Linearity (Pearson only).Pearson measures linear association. A U-shaped or exponential relationship will produce a low r even though the variables are strongly related. If the scatter plot shows curvature, switch to Spearman or fit a non-linear model.
  • Bivariate normality (Pearson only).Both variables should be roughly normally distributed and free of extreme outliers. For skewed data or ordinal scales, Spearman rho is the appropriate alternative.
  • Monotonicity (Spearman).Spearman only requires the relationship to be monotonic — as X increases, Y consistently increases or decreases. It is far less sensitive to outliers than Pearson.
  • Independent pairs.Each (X, Y) pair must come from a different subject or event. Repeated measurements on the same person require a mixed-model correlation or partial correlation.
  • Correlation is not causation.A strong r can reflect a common cause, reverse causation or pure coincidence. Experimental design, not correlation magnitude, establishes causality.

Related calculators

Frequently asked questions

Is the correlation calculator free?+

Yes. Pearson, Spearman and correlation matrices are free and unlimited. The scatter plot and matrix heatmap come at no extra cost.

When should I use Pearson vs Spearman?+

Use Pearson when both variables are continuous, roughly normally distributed and related linearly. Use Spearman for ranked data, skewed distributions, or whenever a scatter plot shows a monotonic but non-linear shape. Spearman is also safer when outliers are present.

Can I compute a correlation matrix for more than two variables?+

Yes. Pick the matrix option inside the Correlation category, select all numeric columns you want to screen, and the analyzer returns a colour-coded matrix plus the p-values with an automatic Bonferroni adjustment.

Why is my significant correlation so small?+

Statistical significance depends on sample size. In a dataset of ten thousand rows, even an r of 0.03 can be significant. Always report both r and the p-value, and judge strength by the coefficient itself, not by the star count.

Can correlation prove cause and effect?+

No. Correlation is a statement about association, not causation. Establishing causality needs experimental design, temporal ordering and a plausible mechanism — none of which a correlation alone can supply.

Ready to run your own analysis?

Open the full DeepStats analyzer — free, browser-based, no account required.