Edit the matrix, paste data, or change dimensions up to 8 x 8.
Enter a matrix to compute its decomposition.
Compute singular values, U, Sigma, V, rank, and low-rank approximations for a numeric matrix.
Results are calculated automatically as you enter data.
Edit the matrix, paste data, or change dimensions up to 8 x 8.
Enter a matrix to compute its decomposition.
▼ See explanations and tips below ▼
Singular value decomposition, usually shortened to SVD, is a way to break a real matrix into simpler parts. It rewrites a matrix as a product of three matrices:
In this factorization, \(A\) is the original matrix, \(U\) and \(V\) describe orthogonal directions, and \(\Sigma\) contains nonnegative numbers called singular values. Those singular values are usually listed from largest to smallest.
A helpful way to think about SVD is this: a matrix transformation can rotate or reflect input directions, stretch or shrink them by certain amounts, and then rotate or reflect the result again. The singular values are the stretching factors. A large singular value means the matrix has a strong effect in that direction. A zero or very small singular value means that direction contributes little or may be lost by the transformation.
SVD is useful because it works for many matrices that ordinary eigenvalue decomposition does not handle well. The matrix does not need to be square, symmetric, or invertible. This makes SVD one of the most important tools in linear algebra, numerical computing, data analysis, image compression, principal component analysis, and low-rank approximation.
SVD is valuable because it organizes the information in a matrix by importance. The first singular value and its singular vectors describe the strongest rank-one pattern in the matrix. The next singular value describes the strongest remaining pattern, and so on.
This ordering makes SVD useful for questions such as:
For students, SVD connects matrix multiplication, orthogonality, eigenvalues, rank, and approximation. For data science and engineering learners, it explains why a high-dimensional matrix can sometimes be represented accurately by a much smaller number of components.
For a real \(m \times n\) matrix \(A\), the singular value decomposition has the form:
where:
The singular values can be found from the symmetric matrix \(A^TA\). If \(\lambda_i(A^TA)\) is an eigenvalue of \(A^TA\), then the corresponding singular value is:
For each nonzero singular value, the corresponding left singular vector can be found from the right singular vector:
This is why SVD is closely related to eigenvalues and eigenvectors, but it is more flexible. The matrix \(A^TA\) is always square and symmetric, even when \(A\) itself is rectangular.
SVD can also be written as a sum of rank-one pieces:
where \(r\) is the rank of \(A\). This form shows why singular values are useful for approximation. Keeping the first \(k\) terms gives a rank-\(k\) approximation:
The first \(k\) terms preserve the largest singular-value patterns. The mathematical result behind this best-approximation idea, under common matrix-error measures such as the Frobenius norm, is commonly known as the Eckart-Young theorem.
A common way to summarize how much structure is captured by the first \(k\) singular values is to use squared singular values:
This is why the largest singular values often dominate the energy table. A singular value that is twice as large contributes four times as much squared energy.
Consider the matrix:
This matrix already stretches the first coordinate by \(4\) and the second coordinate by \(1\). Its singular values are:
The squared singular values are:
So the first singular value accounts for:
The second singular value accounts for:
This simple example shows why energy percentages can be dominated by the largest singular value.
Now consider:
Each row is a multiple of the first row, so the matrix has only one independent row direction. It is a rank-one matrix. In fact, it can be written as:
Its only positive singular value is:
All remaining singular values are zero. A rank-\(1\) approximation reconstructs this matrix exactly because the matrix already has rank \(1\).
Suppose a matrix has singular values:
The total squared singular-value energy is:
A rank-\(1\) approximation keeps only the first singular value:
A rank-\(2\) approximation keeps the first two singular values:
In this case, rank \(2\) keeps nearly all of the squared singular-value energy, while rank \(1\) may still miss visible structure.
The singular values are the most important part of the result. They tell you how strongly the matrix scales different orthogonal directions.
A large singular value means the matrix has a strong effect in that direction. A small singular value means that direction has little effect. A zero or near-zero singular value indicates a direction that is collapsed or numerically negligible.
The numerical rank is based on how many singular values exceed a scale-relative tolerance proportional to \(\sigma_1\max(m,n)\epsilon\), where \(\epsilon\) is floating-point machine precision. This makes the classification invariant under safe nonzero rescaling, but it remains a numerical estimate rather than a symbolic proof of exact rank.
The energy contribution table shows each singular value’s share of total squared singular-value energy. If the first few rows account for most of the energy, a low-rank approximation may preserve much of the matrix’s main structure.
The rank-\(k\) approximation uses only the first \(k\) singular directions. Its quality depends on how quickly the singular values drop. If the singular values fall sharply, a small \(k\) may work well. If they decline slowly, a small \(k\) may lose important information.
The relative reconstruction error compares the Frobenius norm of the reconstruction residual with the Frobenius norm of the original matrix. The calculator also verifies that \(U\) and \(V\) are orthogonal before reporting success.
The relative low-rank error compares the original matrix with the selected rank-\(k\) approximation. This error should generally decrease as \(k\) increases, because more singular directions are included.
The displayed \(U\), \(\Sigma\), and \(V\) matrices correspond to the formula:
The calculator displays \(V\), while the formula uses \(V^T\) during reconstruction.
The conceptual graph uses the first two singular values to sketch how unit directions are transformed. It is a helpful two-dimensional picture, not a full visualization of every dimension in a larger matrix.
Leaving a blank cell and expecting the placeholder to count as zero. A placeholder is only a visual hint. To use zero, enter 0 as the actual matrix value.
Pasting rows with different lengths. A matrix must have the same number of entries in every row. An import such as one row with three numbers and another row with two numbers is not a valid rectangular matrix.
Entering fractions, complex numbers, or expressions. The calculator accepts real decimal numbers and scientific notation such as 1e-3. It does not parse fraction strings, complex values, variables, or algebraic expressions.
Confusing \(\Sigma\) with an ordinary dense matrix. In SVD, \(\Sigma\) is diagonal or rectangular diagonal. Its nonzero entries appear only on the diagonal.
Assuming rank is always exact. Numerical software needs a threshold for tiny values. A singular value very close to zero may be treated as zero for rank purposes.
Assuming a larger requested rank will always be kept. The selected approximation rank is clamped to the valid range. It cannot exceed the matrix’s effective rank or the maximum possible rank when the numeric rank is nonzero.
Rounding too early. Rounded display values are easier to read, but they can hide small numerical differences. Use more decimal places when you need to inspect near-zero values.
Treating the conceptual graph as a complete plot. The graph is based on the first two singular values. It does not show every singular direction in a matrix with more dimensions.
Confusing full reconstruction error with low-rank error. Full reconstruction error checks whether the SVD factors reproduce the original matrix. Low-rank error checks how much information is lost after keeping only the selected rank.
Use SVD when you want to:
SVD is especially useful when a matrix is not square or when ordinary eigenvalue methods do not directly apply.
This calculator works with real, finite numeric matrices. It does not parse complex numbers, symbolic variables, algebraic expressions, or fraction strings.
Matrices are limited to \(1\) through \(8\) rows and \(1\) through \(8\) columns. This keeps the display responsive and readable, but it means the tool is intended for learning, checking small examples, and exploring concepts rather than processing large datasets.
The calculation is numerical, not symbolic. The matrix is normalized before a one-sided Jacobi SVD is computed, which avoids forming \(A^TA\) and improves behavior for very large, very small, and ill-conditioned inputs. Results that do not pass convergence, reconstruction, and orthogonality checks are rejected instead of displayed as successful.
Displayed decimal precision can be set from \(2\) to \(10\) decimal places. If the precision field is blank or invalid, the display uses a default precision of \(5\) decimal places. Very large or very small displayed values may use exponential notation.
The full relative reconstruction error should be close to zero but may not be exactly zero. The low-rank approximation error is expected to be larger unless the selected rank captures the full numerical rank.
The rank selector permits rank \(0\) for an all-zero matrix and is otherwise kept between \(0\) and the reported numerical rank.
If all singular values are zero, the matrix has no nonzero squared singular-value energy. In that case, energy percentages are a display convention rather than evidence that one direction explains meaningful structure.
The implementation normalizes the matrix and uses pair-scaled one-sided Jacobi rotations rather than forming \(A^TA\). Inputs and results must still be finite binary64 numbers; an extreme condition range can exceed the available precision or make a reconstructed value unrepresentable. If a calculation is rejected, rescale the matrix or use specialized numerical software.
For engineering, scientific, financial, or safety-related work, treat the results as a computational aid. Double-check important calculations with appropriate software, documentation, and professional judgment.
0 in the cell.
2.5, -4, or 1e-3.
No. One of the main advantages of SVD is that it works for rectangular matrices as well as square matrices. For a real \(m \times n\) matrix, \(\Sigma\) has the same rectangular shape as the original matrix.
Singular values are nonnegative scaling factors. They describe how much the matrix stretches or preserves information along special orthogonal directions. Larger singular values represent stronger directions in the matrix.
For a real matrix \(A\), the singular values are the square roots of the eigenvalues of \(A^TA\):
This relationship is useful because \(A^TA\) is symmetric and square, even when \(A\) is rectangular.
Energy is based on \(\sigma_i^2\) because squared singular values measure squared magnitude contributions. This is why one large singular value can dominate the total energy. For example, a singular value of \(10\) contributes \(100\) squared units, while a singular value of \(1\) contributes only \(1\).
The rank describes how many singular values are treated as nonzero. The selected rank \(k\) is the number of leading singular directions used for the low-rank approximation. The selected rank may be clamped so it stays within a valid range for the matrix.
The calculation is numerical, so tiny roundoff differences can occur. If the matrix is well scaled, the full reconstruction error should usually be very small. Display rounding can also make small values appear as zero or hide tiny differences.
No. This calculator accepts real finite numbers only. Complex-valued SVD is an important general topic, but complex entries are not supported here.
Books and Open Textbooks
Online and Official Sources