SVD Calculator
Break any matrix into a turn, a stretch along the axes, and another turn. The singular values show how much it stretches, and how close it comes to losing a dimension.
Matrix
Enter any matrix up to 6×6, or start from an example.
Up to 6 rows and 6 columns.
Use integers, decimals, or fractions such as 1/3. Paste rows from a spreadsheet or a Python list into any cell.
Input
Singular value decomposition
Updates as you type.
An SVD generally has no exact form, so these values are found numerically and rounded to 6 places. Rebuilding A from them is accurate to about 15 decimal places.
Rank 2, the number of nonzero singular values. This count comes from exact arithmetic.
Condition number 3: the largest stretch divided by the smallest.
The route through AᵀA
is symmetric, with exact entries. Its eigenvalues are real and at least 0, and its eigenvectors can be chosen perpendicular.
What the SVD says
Every matrix, of any shape, can be written as three factors:
and have perpendicular unit columns, so they only turn or flip. is diagonal, with the singular values . So any matrix turns the space, stretches along the axes, and turns again. A unit circle always lands on an ellipse, and its semi-axes are the singular values.
Unlike the Matrix Diagonalization Calculator, this always works, even for rectangular and defective matrices.
How it relates to eigenvalues
Multiplying by its transpose cancels :
That's a diagonalization of a symmetric matrix. So the singular values are the square roots of the eigenvalues of , which you can find with the Eigenvalue and Eigenvector Calculator, and holds its eigenvectors. Each column of then follows from .
Software rarely computes it this way, because squaring the entries loses accuracy on small singular values. This calculator uses one-sided Jacobi rotations, and it shows the route through because that's the one to learn.
What singular values tell you
The number of nonzero singular values is the Matrix Rank Calculator. The condition number measures how close a square matrix is to losing a dimension. A large value means small changes in the input can cause large changes in a solved system.
Keeping only the largest singular values gives the best possible approximation of lower rank, which is the idea behind image compression and principal component analysis. The SVD also gives the most reliable way to solve Least Squares Calculator problems when columns are nearly dependent.
Related calculators
Keep working with matrices.
Eigenvalue and Eigenvector Calculator
Find eigenvalues and eigenvectors with exact fractions, square roots, and complex values, plus each multiplicity. Spin a vector until the matrix only stretches it.
Matrix Diagonalization Calculator
Write a square matrix as PDP⁻¹, exactly when you can, or see which eigenvalue is short of eigenvectors. Watch it change basis, scale along axes, and change back.
Matrix Rank Calculator
Find rank and nullity with exact fractions, get bases for the column, row, null, and left null spaces, and see what a matrix collapses.
Least Squares Calculator
Fit a line through points or solve Ax ≈ b, exactly. Drag points and watch the residual squares shrink, follow the normal equations step by step, and try fitting a line by hand.