Covariance and Correlation Calculator

Compute covariance correlation and detailed stats for two datasets with precision choose sample or population handle weights missing values and CSV input view step by step formulas live charts and export results for analysis education research and engineering workflows simple interface responsive design and instant validation ensure accuracy audit trail explanations and clear units

Paste numbers separated by spaces newlines semicolons or commas. First two CSV columns also supported below.
If blank each pair gets weight 1. Length will auto adjust to the number of pairs.
About this tool

Calculates weighted or unweighted covariance and Pearson correlation between two data series. Choose sample or population formulas. Upload CSV or paste values directly.

Advanced Weighted CSV
Formulas
Weighted mean \u03BC = \u2211 wᵢ xᵢ / \u2211 wᵢ
Weighted variance σ² = \u2211 wᵢ (xᵢ - \u03BC)² / D
Weighted covariance cov(X,Y) = \u2211 wᵢ (xᵢ-\u03BCₓ)(yᵢ-\u03BCᵧ) / D
D = \u2211 wᵢ for population mode or \u2211 wᵢ - 1 for sample mode.
Pearson r = cov(X,Y) / (σₓ σᵧ)
FAQs
What is the difference between sample and population mode?
Sample mode divides by n−1 or total weight minus one to reduce bias when data are a subset. Population mode divides by n or total weight when the dataset is complete.
How are weights applied?
Each pair receives a nonnegative weight. Means variances and covariance are computed with weights. By default weights are all one. If the provided list is shorter it will be padded.
Can I upload data from a spreadsheet?
Yes. Export your sheet to CSV and upload it. The tool reads the first two numeric columns as X and Y while ignoring nonnumeric entries.
Why is correlation NaN?
Correlation requires both standard deviations to be positive. If either series has zero spread correlation is undefined and will show as NaN.
Does this compute Spearman or Kendall correlation?
This version reports Pearson correlation. For ranked or ordinal relationships convert to ranks first or request a specialized rank correlation tool.
How are missing values handled?
Pairs are aligned by position and any nonnumeric entries are discarded automatically so the effective sample size may be smaller than the raw input counts.
What precision is used in results?
Use the Decimal places control to set rounding from 0 to 12. Internally calculations use double precision and are rounded only for display.
Is the weighted sample correction unbiased?
For general weights several unbiased forms exist. This tool uses a simple W−1 correction which matches frequency weights. For complex survey weights consider domain specific formulas.

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.