Regression & multivariate

PCA Calculator: Principal Component Analysis with Scree Plot and Biplot

Turn many correlated measurements into a few principal components. Paste your data (one row per sample, one column per variable), pick the variables and an optional group column, and get the eigenvalues, the percentage of variance explained, the loadings, a scree plot and a biplot coloured by group, plus KMO and Bartlett’s test and a sentence for your methods and results.

✅ No login needed100% freeRuns in your browserYour data stays on your device
PCA 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.

Variables to include

  • 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). PCA calculator: principal component analysis with scree plot and biplot [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/pca-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 PCA Calculator

  1. Paste your data table or use Paste from Excel / Upload CSV / Excel. Each row is one sample (plant, patient, site, sample), each column one variable, and the first row holds the column names. The classic iris data (150 flowers, 4 measurements, 3 species) is loaded as an example.
  2. Tick the numeric variables to include. Pick a group column to colour the points (for example species, treatment or site) and, if you like, a column with point labels.
  3. Keep Correlation matrix unless all variables are in the same units and you want large-variance variables to dominate. Click Run PCA.
  4. Read the eigenvalue table and scree plot to decide how many components to keep, then interpret the loadings. Download the scree plot and biplot as PNG or SVG, copy the tables into Word and download the component scores to use in other analyses.

What does principal component analysis do?

Principal component analysis (PCA) replaces many correlated variables with a few new, uncorrelated variables called principal components. The first component is the direction in which the samples differ most; the second is the direction of greatest remaining variation at right angles to the first, and so on. If the first two or three components explain most of the variance, you can plot and analyse your samples in two or three dimensions instead of ten or twenty.

Researchers use PCA to explore field-trial and breeding data (which genotypes are similar across many traits?), soil and water chemistry, morphometrics, metabolomics and gene expression, and to build indices from questionnaires. It is also a common first step before cluster analysis or regression with many correlated predictors.

How to read the results

  • Eigenvalue: the variance captured by a component. With the correlation matrix the eigenvalues add up to the number of variables, so a component with an eigenvalue above 1 explains more than one original variable (the Kaiser rule).
  • % of variance: eigenvalue ÷ sum of eigenvalues. Report it for each component you keep, and the cumulative total.
  • Scree plot: keep the components before the curve flattens out (the “elbow”). Use it together with the Kaiser rule and the interpretability of the components.
  • Loadings: the weight of each variable in each component. Variables with large positive or negative weights define what a component means (for example “PC1 = overall plant size”).
  • Biplot: points are samples, arrows are variables. Samples close together are similar; an arrow points towards samples with high values of that variable; arrows at small angles are positively correlated, at 180° negatively correlated and at 90° uncorrelated.
  • KMO and Bartlett’s test: KMO above 0.6 and a significant Bartlett’s test show that the variables share enough correlation for PCA to be useful.

How PCA is calculated

Standardise each variable: z = (x − mean) / SD (correlation-matrix PCA) R = correlation matrix of the variables (or S = covariance matrix of centred data) Eigen-decomposition: R = V Λ Vᵀ Λ = eigenvalues λ₁ ≥ λ₂ ≥ … , V = loadings % variance of PC k = λₖ / Σλ × 100 Scores = Z V (one row per sample, one column per component) Variable–component correlation = vⱼₖ × √λₖ KMO = Σ r²ᵢⱼ / (Σ r²ᵢⱼ + Σ a²ᵢⱼ) a = partial correlation (i ≠ j) Bartlett: χ² = −[(n − 1) − (2p + 5)/6] · ln|R|, df = p(p − 1)/2

The eigenvalues, loadings and scores match R’s prcomp(x, scale. = TRUE) (choose the covariance matrix for scale. = FALSE), apart from the sign of each component, which is arbitrary in every program. This tool makes the largest loading of each component positive. KMO and Bartlett’s test match psych::KMO() and psych::cortest.bartlett().

How to report a PCA

A principal component analysis was performed on the correlation matrix of the four flower measurements (n = 150). The first two components explained 73.0% and 22.9% of the variance (95.8% together). PC1 was dominated by petal length, petal width and sepal length (loadings 0.58, 0.57 and 0.52), and PC2 by sepal width (0.92).

State whether you used the correlation or covariance matrix, how many components you kept and why (scree plot, Kaiser rule, cumulative variance), and give a loadings table. New to multivariate statistics? Start with the free ABC of statistics series, and learn to run PCA in R in the R with Aammar course.

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

Frequently asked questions

Should I use the correlation or the covariance matrix?

Use the correlation matrix (standardised variables) when the variables are measured in different units or have very different variances, which is almost always the case in field, lab and survey data. Use the covariance matrix only when all variables share the same unit and their differences in variance are meaningful, for example the same chemical measured at several depths.

How many principal components should I keep?

Combine three rules: the Kaiser rule (eigenvalue above 1 for correlation-matrix PCA), the elbow in the scree plot, and a cumulative variance target (often 70–80%). Then keep only components you can interpret. Report which rules you used.

Why are the signs of my loadings different from SPSS or R?

The sign of a principal component is arbitrary: multiplying all its loadings and scores by −1 gives exactly the same solution. Programs pick signs differently. This tool makes the largest loading of each component positive. Interpret the pattern of signs within a component, not the overall sign.

Is PCA the same as factor analysis?

No. PCA summarises the total variance of the variables, while factor analysis models only the shared variance with latent factors and an error term. PCA is mainly a data-reduction and exploration tool. For questionnaire scales, report reliability with Cronbach’s alpha and consider a proper factor analysis in R or SPSS.

How many samples do I need for PCA?

There is no single rule. Common advice is at least 5–10 rows per variable, and at least 50–100 rows for stable loadings. With fewer rows than variables, PCA still runs, but only n − 1 components exist and the loadings are unstable. Check the KMO value as well.

What happens to rows with missing values?

Rows with a missing value in any selected variable are left out (listwise deletion), and the number dropped is shown. If many rows are dropped, consider removing the variable with the most missing values.

Can I use the component scores in further analysis?

Yes. Download the scores as CSV and use them as uncorrelated predictors in regression or ANOVA, or as input for clustering. Report that the variables were standardised before PCA.

Is my data uploaded?

No. The PCA runs entirely in your browser. Pasted and uploaded data never leave your device.

Do I need to log in or create an account to use the PCA 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). PCA calculator: principal component analysis with scree plot and biplot [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/pca-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.