# SVD Calculator

Created by Anna Szczepanek, PhD
Reviewed by Rijk de Wet
Last updated: Feb 02, 2023

The singular value decomposition of matrices will never cause you any problems again — with the help of our SVD calculator, you will quickly master this important topic in linear algebra. Scroll down and learn:

• What is the singular value decomposition?

• How do I find the SVD of a matrix using our SVD calculator?

• How to calculate the SVD of a matrix by hand?

• Is the singular value decomposition unique?

## What is the singular value decomposition?

Singular value decomposition (SVD) is a way of factorizing a matrix: any real matrix $A$ of size $m \times n$ decomposes as

$A = U\Sigma V^T$

where $U$ and $V$ are orthogonal matrices of sizes $m\times m$ and $n\times n$ respectively, and $\Sigma$ is a rectangular matrix of the same size as $A$ (so $m \times n$) which has non-negative numbers on its diagonal and zeroes everywhere else. The diagonal elements of $\Sigma$ are in fact the singular values of $A$.

🙋 If $A$ is complex, replace the transposition (we also have matrix transpose calculator to help you with that) $V^T$ with the complex conjugation $V^*$. $U$ and $V$ then become unitary matrices, but $\Sigma$ still features real non-negative numbers on its diagonal.

Here's a visualization of singular value decomposition of a $4\times 3$ matrix $M$.

Once we know what the singular value decomposition of a matrix is, it'd be beneficial to see some examples. Calculating SVD by hand is a time-consuming procedure, as we will see in the section on How to calculate SVD of a matrix. We bet the quickest way to generate examples of SVD is to use Omni's singular value decomposition calculator!

## How to use this SVD calculator?

Working with this SVD calculator is simple!

1. Pick the matrix size: the number of rows and the number of columns in $A$.
2. Enter the matrix entries in their dedicated fields.
3. The components of singular value decomposition $U$, $\Sigma$ and $V^T$ will appear at the bottom of the calculator.

Do you want to verify the results? Just perform the matrix multiplication of the result's three matrices and compare that outcome with your initial matrix. Remember that numerical computations and rounding may cause tiny discrepancies!

Do you want to understand how the SVD calculator got its results? In the next section, we will discuss all the theory that stands behind the singular value decomposition and explain step-by-step how to find the SVD of a matrix. Ready?

## How to calculate SVD of a matrix?

Here's how to calculate the singular value decomposition of a $m \times n$ matrix $A$ by hand. We will see that SVD is closely related to the eigenvalues and eigenvectors of $A$.

As we remember, we can easily find the eigenvalues and eigenvectors for square matrices, yet $A$ can be rectangular in SVD. What can we do? Let's consider two square matrices that are closely related to $A$: these matrices are $A^TA$ and $AA^T$:

• The columns of $V$ are eigenvectors of $A^TA$.
• The non-zero elements of $\Sigma$ are the non-zero singular values of $A$, i.e., they are the square roots of the non-zero eigenvalues of $A^TA$.
• Once we know $V$ and $\Sigma$, we can recover $U$ from the SVD formula ($A = U\Sigma V^T$).

In more details, to find SVD by hand:

1. Compute $A^TA$.

2. Compute the eigenvalues and eigenvectors of $A^TA$.

3. Draw a matrix of the same size as $A$ and fill in its diagonal entries with the square roots of the eigenvalues you found in Step 2. This is $\Sigma$.

4. Write down the matrix whose columns are the eigenvectors you found in Step 2. This is $V$.

5. The SVD equation $A = U\Sigma V^T$ transforms to $AV = U\Sigma$. We can rewrite this in terms of columns as $A v_i = \sigma_i u_i$. This tells us how to compute $U$, as the columns of $U$ set $u_i = \frac 1 {\sigma_i} A v_i$ for every $i$ such that $\sigma_i \neq 0$.

6. If $U$ needs more columns to fill its size, you can pick arbitrary vectors, but you have to make sure that $U$ is an orthogonal matrix. Therefore, you must pick vectors that have unit length and are orthogonal to all the columns in $U$ (and the ones you're adding).

## Is singular value decomposition unique?

No, the SVD is not unique. Even if we agree to have the diagonal elements of Σ in descending order (which makes Σ unique), the matrices U and V are still non-unique.

## FAQ

### What does SVD do to a matrix?

SVD decomposes an arbitrary rectangular matrix A into the product of three matrices UΣVᵀ, which is subject to some constraints. These U and V are orthogonal matrices. Σ has the same size as A and contains the singular values of A as its diagonal entries.

### What is SVD of a symmetric matrix?

If A is real symmetric, then its singular values (the diagonal elements of Σ) coincide with the absolute values of its eigenvalues. The columns of U and V are the unit eigenvectors of A. In particular, if the eigenvalues of A are all strictly positive (i.e. A is positive definite), then U = V and the SVD of A coincides with the eigendecomposition of A.

### What is SVD of a unitary matrix?

For unitary matrices, SVD is trivial. Namely, if A is unitary (i.e., AA = AA* = I), then all of the singular values of A are equal to 1. Hence, in SVD we have U = A , Σ = I, and V = I.

Anna Szczepanek, PhD
Matrix size
Number of rows
2
Number of columns
2
A=
 ⌈ a1 a2 ⌉ ⌊ b1 b2 ⌋
Matrix entries
a₁
a₂
b₁
b₂
People also viewed…

### Coffee kick

A long night of studying? Or maybe you're on a deadline? The coffee kick calculator will tell you when and how much caffeine you need to stay alert after not sleeping enough 😀☕ Check out the graph below!

### Helium balloons

Wondering how many helium balloons it would take to lift you up in the air? Try this helium balloons calculator! 🎈 