Percentages and Math

PCA Calculator

Paste a table of numbers to find the directions that carry the most variation.

Your numbers

One case per line, 2 to 8 columns, separated by commas, semicolons or tabs. Example data.

Result

Variance in the first two components

98.09%

Correlation matrix of 10 cases and 3 columns.

Variance in PC1
94.49%
Variance in PC2
3.60%
First two together
98.09%
Eigenvalue of PC1
2.8347
Eigenvalue of PC2
0.1081
Sum of eigenvalues
3.0000
Cases and columns
10 and 3

Components

ComponentEigenvalueVariance explainedCumulative
PC12.834794.49%94.49%
PC20.10813.60%98.09%
PC30.05721.91%100.00%

Loadings (weight of each column in each component)

ColumnPC1PC2PC3
Size0.57390.7412-0.3483
Weight0.5825-0.07060.8097
Age-0.57560.66760.4723

Scores

CasePC1PC2
11.35020.0204
2-2.3339-0.5049
31.6504-0.5079
40.16010.1829
52.64020.0281
61.23510.0101
7-0.44280.6325
8-1.86860.1372
9-0.72060.0588
10-1.6701-0.0570
How this was calculated
  1. Subtract each column mean and divide by its standard deviation, so every column counts equally.
  2. Build the 3 x 3 correlation matrix and find its eigenvalues and eigenvectors with Jacobi rotations.
  3. The eigenvalues add up to 3.0000, the total variance. PC1 holds 2.8347 of it, 94.49%.
  4. A score is the case row (centered, and scaled for the correlation version) multiplied by a loading column.
  • The sign of a component is arbitrary, so this page makes the largest loading in each component positive. Components are combinations of the columns and are only as meaningful as the columns. They describe this table and do not say what causes the patterns.

Calculated using SumPanda.com · https://sumpanda.com/pca-two-component-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the pca calculator

  1. Paste a table with one case per line and 2 to 8 numeric columns. Tick the box if the first line holds column names.
  2. Choose the correlation matrix when columns use different units or scales, or the covariance matrix to keep original units.
  3. Read the variance share of the first two components, the full table of eigenvalues and the loadings.
  4. Use the scores for the first cases, or download all scores as CSV for a scatter plot of PC1 against PC2.

Formula

Z = centered data (each column also divided by its standard deviation for the correlation version)

C = Z' Z / (n - 1), a p x p symmetric matrix

C v = lambda v (eigenvalues lambda, unit eigenvectors v, found with Jacobi rotations)

Variance explained by component j = lambda_j / sum of all lambda

Score of a case on component j = its row of Z multiplied by v_j

The eigenvalues add up to the trace of C: p for the correlation matrix, or the sum of the column variances for the covariance matrix. Each component is signed so its largest loading is positive.

Ten cases and three measurements

The default table has columns Size, Weight and Age for 10 cases. On the correlation matrix the eigenvalues are 2.8347, 0.1081 and 0.0572, which add up to 3. The components explain 94.49%, 3.60% and 1.91% of the variance.

PC1 loads 0.5739 on Size, 0.5825 on Weight and -0.5756 on Age, so it contrasts big, heavy cases with older ones. The first case scores 1.3502 on PC1 and 0.0204 on PC2. On the covariance matrix the first component explains 94.75%, and the first two together 98.06%.

What the components are

Principal component analysis rotates the data to new axes that are uncorrelated and ordered by how much variation they carry. The first component is the direction along which the cases are most spread out, the second is the most spread out direction at right angles to the first, and so on. Often the first two components hold most of the variation, and a scatter plot of their scores shows the structure of a many-column table in two dimensions.

The loadings tell you how the original columns combine into each component. Large loadings of the same sign mean the columns move together along that axis, and opposite signs mean they trade off.

Correlation or covariance

With columns in different units, such as height in centimeters and income in dollars, the covariance version lets the column with the biggest numbers dominate. Standardizing first, which is what the correlation matrix does, gives each column an equal say. When all columns share a unit and size matters, the covariance version keeps that information.

For a straight-line relationship between two columns use the linear regression calculator, and for matrix arithmetic see the matrix calculator. The components describe the table you enter and do not show causes. Use the descriptive statistics page to inspect each column first.

Assumptions and limits

  • The columns are numeric and measured for every case, with no blanks.
  • Relationships between columns are roughly straight-line, which is what the correlation and covariance capture.
  • A column with no variation is not allowed in the correlation version, because it cannot be standardized.
  • Signs of components are arbitrary; here the largest loading is made positive so results are reproducible.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

How many components should I keep?

There is no single rule. People look at where the cumulative share levels off, keep components with eigenvalues above the average, or keep as many as the purpose needs. This page reports the full table so you can decide.

Why do my results differ from a spreadsheet add-in?

Differences usually come from the matrix used (correlation or covariance), from dividing by n instead of n - 1, or from component signs. Eigenvalues and shares should agree when the same matrix and divisor are used.

Can a component be negative in variance?

No. Eigenvalues of a covariance or correlation matrix are never below zero. Tiny negative values that appear in some software are rounding noise, and this page shows them as zero.

Does it work with more than 8 columns?

The page is limited to 8 columns and 2,000 cases so the table, loadings and scores stay readable. For wider tables use a statistics package.