Omni Calculator logo

SVD Calculator

Created by Anna Szczepanek, PhD
Reviewed by Rijk de Wet
Last updated: Jan 18, 2024


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?

Ready? Let's go!

What is the singular value decomposition?

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

A=UΣVTA = U\Sigma V^T

where UU and VV are orthogonal matrices of sizes m×mm\times m and n×nn\times n respectively, and Σ\Sigma is a rectangular matrix of the same size as AA (so m×nm \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 AA.

🙋 If AA is complex, replace the transposition (we also have matrix transpose calculator to help you with that) VTV^T with the complex conjugation VV^*. UU and VV 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×34\times 3 matrix MM.

Visualisation of SVD
Cmglee, CC BY-SA 4.0, via Wikimedia Commons

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 AA.
  2. Enter the matrix entries in their dedicated fields.
  3. The components of singular value decomposition UU, Σ\Sigma and VTV^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×nm \times n matrix AA by hand. We will see that SVD is closely related to the eigenvalues and eigenvectors of AA.

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

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

In more details, to find SVD by hand:

  1. Compute ATAA^TA.

  2. Compute the eigenvalues and eigenvectors of ATAA^TA.

  3. Draw a matrix of the same size as AA 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 VV.

  5. The SVD equation A=UΣVTA = U\Sigma V^T transforms to AV=UΣAV = U\Sigma. We can rewrite this in terms of columns as Avi=σiuiA v_i = \sigma_i u_i. This tells us how to compute UU, as the columns of UU set ui=1σiAviu_i = \frac 1 {\sigma_i} A v_i for every ii such that σi0\sigma_i \neq 0.

  6. If UU needs more columns to fill its size, you can pick arbitrary vectors, but you have to make sure that UU is an orthogonal matrix. Therefore, you must pick vectors that have unit length and are orthogonal to all the columns in UU (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=
a1a2
b1b2
Matrix entries
a₁
a₂
b₁
b₂
Check out 35 similar linear algebra calculators 🔢
Adjoint matrixCharacteristic polynomialCholesky decomposition… 32 more
People also viewed…

Christmas tree

Welcome to the Christmas tree calculator, where you will find out how to decorate your Christmas tree in the best way. Take a look at the perfect Christmas tree formula prepared by math professors and improved by physicists. Plan in advance how many lights and decorations you'll need!

Length of a line segment

Use the length of a line segment calculator to determine the length of a line segment by entering the coordinates of its endpoints.

Social Media Time Alternatives

Check what you could have accomplished if you get out of your social media bubble.

Spherical coordinates

Spherical coordinates calculator converts between Cartesian and spherical coordinates in a 3D space.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service