Statistics

Correlation Matrix Calculator with P-Values and Heatmap (Pearson and Spearman)

Paste a table with several numeric variables (columns) and get every pairwise correlation at once: Pearson or Spearman r, p-values, the number of complete pairs, stars, an optional Holm or FDR correction, a coloured heatmap and an APA-style correlation table with means and SDs ready for Word. Numbers match R’s Hmisc::rcorr().

✅ No login needed100% freeRuns in your browserYour data stays on your device
Correlation Matrix Calculator✅ Free · no login📚 Cite this tool
Your data never leaves your PC. Your data is analysed on your own computer or phone, even when you upload a CSV or Excel file. Nothing is uploaded, stored or seen by Codanics, and no login is needed.
  • PriceFree, no login or sign-up needed
  • Your dataProcessed in your browser, never uploaded
  • Works onPhone, tablet or computer, any modern browser
  • Made byDr. Muhammad Aammar Tufail, Codanics
  • Published17 November 2026
  • Last updated16 November 2026

📚 How to cite this tool

This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.

Citation · APA 7th edition

Tufail, M. A. (2026). Correlation matrix calculator with p-values and heatmap [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/correlation-matrix-calculator/

In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)

The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 17 November 2026.

🚀 Follow Codanics channel on WhatsApp for more updatesNew free tools, scholarships, PhD positions and research tips, straight to your phone. Free lessons on YouTube too.

How to use the correlation matrix calculator

  1. Paste your table (one column per variable, names in the first row) or use Paste from Excel / Upload CSV / Excel. Text columns such as group names are skipped automatically.
  2. Untick any variables you don’t want, then choose Pearson (linear relationships, roughly normal data) or Spearman (ranks; skewed data, outliers or ordinal scales).
  3. Optionally adjust p-values for the number of pairs (Holm or FDR), choose whether the heatmap shows the lower triangle or the full matrix, and click Calculate correlations.
  4. Copy the APA table into Word, download the heatmap as PNG or SVG, or download the CSV with r, CI, n and p for every pair.

How to read a correlation matrix

Each cell is the correlation between the row variable and the column variable, from −1 (perfect negative) through 0 (no linear relationship) to +1 (perfect positive). The diagonal is always 1, and the matrix is symmetric, so APA tables show only the lower triangle. Stars mark p-values: * p < .05, ** p < .01, *** p < .001. In the heatmap, blue cells are positive and red cells negative; darker means stronger.

|r|Common label (Cohen 1988 / Evans 1996 style)
< 0.10Negligible
0.10 – 0.39Weak
0.40 – 0.69Moderate
≥ 0.70Strong

Formulas

Pearson r = Σ(x − x̄)(y − ȳ) / √[ Σ(x − x̄)² Σ(y − ȳ)² ] Spearman ρ = Pearson r computed on the ranks (ties get average ranks) Test t = r √(n − 2) / √(1 − r²), df = n − 2, two-sided p 95% CI tanh( atanh(r) ± 1.96 / √(n − 3) ) (Pearson only)

Missing values are handled by pairwise deletion: each pair uses all rows where both variables are present, so n can differ between pairs. p-values for Spearman use the same t approximation as Hmisc::rcorr(); R’s cor.test(method = "spearman") uses an exact method for small samples without ties and can differ slightly.

Worked example

The example uses the four measurements of R’s iris data (150 flowers). Petal length and petal width correlate at r = .963 (p < .001), and sepal length and sepal width at only r = −.118 (p = .152). Spearman gives ρ = .938 and −.167 (p = .041). Values are identical to Hmisc::rcorr(as.matrix(iris[, 1:4])).

Should I adjust for multiple testing?

A matrix of 10 variables has 45 pairs, so a few will be “significant” by chance. If you are testing specific hypotheses, adjust with Holm; for exploratory screening, use the Benjamini–Hochberg FDR. Always remember that correlation does not imply causation, and that a correlation only measures linear (Pearson) or monotonic (Spearman) association. For one pair with a scatter plot and regression line, use the correlation and regression calculator.

Learn the statistics behind these numbers. Codanics has free statistics, R and Python lessons on YouTube and full courses for researchers.

Frequently asked questions

How do I make an APA correlation table?

Paste your data, choose Pearson or Spearman and click Copy APA table for Word. The table lists each variable’s n, mean and SD, then the lower triangle of correlations with stars, and a note explaining the stars, in APA 7 style.

Pearson or Spearman: which should I use?

Use Pearson for continuous, roughly normal variables with a linear relationship. Use Spearman for ordinal data (such as Likert items), skewed variables, outliers or relationships that are monotonic but not linear.

How are missing values handled?

Pairwise deletion: each correlation uses every row where both variables have a value. The n for each pair is shown in the list of pairs and in the CSV.

Why does SPSS or R give a slightly different Spearman p-value?

This tool and Hmisc::rcorr use the t approximation for Spearman p-values. cor.test in R uses an exact test for small samples without ties, and SPSS uses the t approximation as well. The correlation coefficients themselves are identical.

What does a correlation of 0.9 between two predictors mean for regression?

It suggests multicollinearity: the two variables carry almost the same information, which makes regression coefficients unstable. Consider keeping one of them or combining them.

Is my data uploaded?

No. All calculations run in your browser and nothing is stored or sent anywhere.

Do I need to log in or create an account to use the correlation matrix calculator?

No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.

How do I cite this tool in my thesis or paper?

Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Correlation matrix calculator with p-values and heatmap [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/correlation-matrix-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.

Free guides and courses from Codanics

More free tools

See all free Codanics tools → · Codanics on YouTube · WhatsApp channel

Made by Dr. Muhammad Aammar Tufail, Codanics. First published 17 November 2026, last updated 16 November 2026. Found a bug or have an idea for a new tool? Tell us on the WhatsApp channel or in the comments on YouTube. Results are for learning and planning; check important analyses with a statistician or your supervisor.