Covariance Matrix Calculator
Compute the sample or population covariance matrix of several variables from your data table.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Step 1: Open Covariance Matrix Calculator and add your input
Type your numbers or text, add your file, or pick the options you need. Nothing is uploaded: everything stays in your browser.
- 2Step 2: What Covariance Matrix Calculator does
Compute the sample or population covariance matrix of several variables from your data table.
- 3Step 3: Read the result and compare
The result appears at once. Change one value to see how the answer moves, then keep the figure that fits your case.
- 4Step 4: Copy or save it
Copy the result or download it. For an important decision, confirm it with the official source or an adviser.
About this tool
Paste your data with one column per variable. The calculator gives the covariance matrix with the variances on the diagonal, the mean of each variable and the trace.
Formula
Cov(X, Y) = Σ(xᵢ − x̄)(yᵢ − ȳ) ÷ (n − 1) for a sample, or ÷ n for a population. The diagonal holds the variances and the matrix is symmetric.
Use
The covariance matrix is the input of principal component analysis, portfolio variance and the multivariate normal distribution. For the scaled version see the correlation calculator.
Paste a table with one row per line, the values separated by commas, spaces or tabs, and an optional first line of column names.
Worked example
Three columns a, b, c with 5 rows give a variance of 10 for a, a covariance of −5 between a and b, and 5.5 between a and c (sample, n − 1).
Tips for best results
Check every box before you rely on a result, because one wrong digit changes the whole answer. Use the exact figures from your payslip, bill, certificate or contract, and keep a note of the date you calculated. Rates, thresholds and rules change from time to time, so for tax, fees and legal matters treat the output as an estimate and confirm with the official source named on this page. You can run as many scenarios as you like; nothing is saved or sent, and refreshing the page clears the boxes.
Quick facts
- Category: Math & Science
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in many languages.
- Content last reviewed:
Frequently asked questions
Sample or population?
Use the sample version (n − 1) unless you have the whole population.
What is the diagonal?
The variance of each variable.
What does a negative covariance mean?
The two variables tend to move in opposite directions.
How many columns?
2 to 8.
