SVD Calculator

Introduction to the 2×2 SVD calculator

This 2×2 SVD calculator decomposes a real matrix into the three standard pieces UΣVT. In geometric terms, the factorization describes an orthogonal change of input directions, a stretch along perpendicular axes, and an orthogonal change of output directions. That viewpoint turns four apparently unrelated matrix entries into a clear description of how the matrix transforms the plane.

Enter the four entries of a real 2×2 matrix to calculate U, Σ, and VT. The result also reports an estimated numerical rank and the ratio of the largest to the smallest singular value. These quantities help show whether the transformation stretches the plane relatively evenly, strongly favors one direction, or collapses one direction completely.

The matrix entries have no fixed physical units because a matrix can describe many different systems. Singular values are scale factors between input and output magnitudes. If the entries come from a physical model, those scale factors inherit the model’s output-per-input units. Results are decimal approximations rather than symbolic expressions.

What Singular Value Decomposition means for a 2×2 matrix

Singular Value Decomposition factors a real matrix into orthogonal directions and nonnegative stretch factors. For a real matrix A, the SVD is written as

Formula: A = U Σ V^T

A=UΣVT

where:

  • U is an orthogonal matrix. Its columns are mutually perpendicular unit vectors in the output space.
  • V is another orthogonal matrix. Its columns identify the special perpendicular input directions on which the transformation acts most simply.
  • Σ is diagonal. Its nonnegative diagonal entries are the singular values, which give the stretch applied along those directions.

For the 2×2 case used here, the input has the form

Formula: A = a_11 a_12 a_21 a_22.

A=a11a12a21a22.

The calculator finds matrices U, Σ, and VT satisfying A=UΣVT, apart from ordinary floating-point rounding. Signs are not unique: a corresponding column of U and row of VT may both be multiplied by −1 without changing the reconstructed matrix.

Key formulas for calculating a 2×2 SVD

The singular values of a 2×2 matrix are the square roots of the eigenvalues of ATA. This product is symmetric and positive semidefinite, so its eigenvalues are real and nonnegative apart from tiny floating-point effects. Let

Formula: A^T A = b_11 b_12 b_12 b_22.

AT A= b11b12b12b22.

The eigenvalues λ1 and λ2 come from the characteristic polynomial of ATA. The relationship between an eigenvalue and its singular value is

σ=λ

For a 2×2 matrix, the singular values are conventionally ordered as σ1σ20. A convenient closed form is

Formula: σ_1,2 = sqrt((tr ⁡ (A^T A) ± sqrt(tr⁡(A^TA)^2 − 4 det ⁡ (A^T A))) / 2)

σ1,2=tr(ATA)±tr(ATA)24det(ATA)2

After finding the singular values, the calculator obtains the right singular vectors—the columns of V—from the eigenvectors of ATA. For nonzero singular values, the corresponding left singular vectors can be calculated from

Formula: U = A V Σ^−1,

U=AVΣ1,

with separate handling when a singular value is zero. In a rank-deficient case, the singular vector associated with a zero singular value is not determined by division; an orthogonal completion is used instead.

Verification identities for a 2×2 singular value decomposition

Several related SVD identities help verify the calculator’s output and connect its matrices to familiar measures of size, invertibility, and approximation quality. The Frobenius norm of the original matrix equals the root-sum-square of its singular values:

Formula: ∥_F A ∥ = sqrt(σ_1^2 + σ_2^2).

FA=σ12+σ22.

The magnitude of the determinant is the product of the two singular values. This identity is useful for detecting area collapse:

Formula: | det ⁡ (A) | = σ_1 σ_2.

|det(A)|=σ1σ2.

The spectral norm is simply the largest singular value:

Formula: ∥_2 A ∥ = σ_1.

2A=σ1.

When the matrix is invertible, the spectral norm of its inverse is controlled by the smaller singular value:

Formula: ∥_2 A^−1 ∥ = 1 / σ_2.

2A1=1σ2.

The exact rank equals the number of nonzero singular values, although numerical software must replace exact zero with a scale-aware tolerance:

Formula: rank ⁡ (A) = number ⁡ {i: σ_i > 0}.

rank(A)=number{i:σi>0}.

Multiplying the three reported factors should reconstruct the input matrix, within displayed rounding:

Formula: A ≈ U Σ V^T.

AUΣVT.

Each right singular vector maps to its paired left singular vector, scaled by the associated singular value:

Formula: A v_i = σ_i u_i.

Avi=σiui.

The reverse relationship uses the transpose of the matrix:

Formula: A^T u_i = σ_i v_i.

ATui=σivi.

The columns of the left singular-vector matrix are orthonormal, which can be checked through

Formula: U^T U = I.

UTU=I.

The right singular-vector matrix obeys the matching orthogonality identity:

Formula: V^T V = I.

VTV=I.

For this calculator’s 2×2 output, the singular-value matrix has zeros away from its diagonal:

Formula: Σ = [σ_1 0 0 σ_2].

Σ=[σ100σ2].

The trace of the symmetric product gives the sum of the squared singular values:

Formula: tr ⁡ (A^T A) = σ_1^2 + σ_2^2.

tr(ATA)=σ12+σ22.

Likewise, the determinant of that product is the product of the squared singular values:

Formula: det ⁡ (A^T A) = σ_1^2 σ_2^2.

det(ATA)=σ12σ22.

For a full-rank matrix, the two-norm condition number compares the strongest and weakest stretches:

Formula: κ_2 (A) = σ_1 / σ_2.

κ2(A)=σ1σ2.

If only one singular component is retained, the best rank-1 approximation in the spectral and Frobenius norms is

Formula: A_1 = σ_1 u_1 v_1^T.

A1=σ1u1v1T.

When zero singular values are handled through a pseudoinverse, the SVD gives a direct factorization of that generalized inverse:

Formula: A^+ = V Σ^+ U^T.

A+=VΣ+UT.

Finally, the area of the ellipse produced from the unit circle is the original circle area multiplied by the absolute determinant:

Formula: π σ_1 σ_2 = π | det ⁡ (A) |.

πσ1σ2=π|det(A)|.

These identities are useful diagnostic checks, but displayed values are rounded. Reconstructing a matrix from four-decimal factors can therefore produce a small discrepancy even when the full-precision internal calculation is consistent.

Geometric interpretation of a 2×2 singular value decomposition

A 2×2 SVD can be pictured directly in the two-dimensional plane: the matrix sends the unit circle to an ellipse, a line segment, or a point. The three factors explain that transformation in sequence.

  • Begin with the unit circle, containing all input vectors whose Euclidean length is 1.
  • The rows of VT align the input coordinates with the right singular-vector directions.
  • The diagonal matrix Σ stretches those directions by σ1 and σ2.
  • The columns of U orient the resulting ellipse in the output plane.

The ellipse’s semiaxis lengths are the two singular values. If both are positive, the image remains two-dimensional. If the smaller value is zero, the circle collapses to a line segment and the matrix has rank 1. If both are zero, every input maps to the origin. When the two values are equal, the image is a circle, so no single principal direction is geometrically distinguished.

How to use the 2×2 SVD input form

Using this SVD calculator requires the four real entries of the matrix, entered by row from the upper-left value to the lower-right value.

  1. Enter the entries labeled a11, a12, a21, and a22.
  2. Select Compute SVD. Decimal values, negative values, and zero are accepted.
  3. Read the displayed matrices by rows. The two values shown for Σ are its diagonal entries; its off-diagonal entries are zero.
  4. Use the rank estimate and condition indicator as concise summaries, then inspect the singular vectors when orientation matters.

The calculator automates the eigenvalue, eigenvector, normalization, and orthogonal-completion steps. It is especially useful when the arithmetic is awkward, although results for repeated or nearly repeated singular values should be interpreted with the non-uniqueness of singular vectors in mind.

Interpreting the 2×2 SVD results

The calculated 2×2 SVD is easiest to interpret as a sequence of input directions, stretch factors, and output directions rather than as three unrelated blocks of numbers.

Singular values in Σ. The diagonal entries σ1 and σ2 measure the maximum and minimum stretch of unit input vectors.

  • If the singular values are comparable and nonzero, the transformation has similar sensitivity in both principal directions.
  • If σ2 is very small compared with σ1, the matrix is close to rank 1 and is sensitive to perturbations when used in an inverse problem.
  • If one singular value is zero, the matrix is rank-deficient and not invertible.

Left singular vectors in U. The columns of U are perpendicular unit vectors in the output space. They point along the principal axes of the transformed unit circle.

Right singular vectors in V. The columns of V are perpendicular unit vectors in the input space. Applying A to each right singular vector produces the corresponding left singular direction scaled by its singular value.

The condition indicator is σ1σ2. A value near 1 indicates similar stretching in both principal directions. A large value indicates anisotropic stretching and greater sensitivity. The indicator is infinite when the smaller singular value is treated as zero.

Worked example: SVD of the matrix [3 1; 0 2]

For a concrete 2×2 SVD example, consider the matrix

Formula: A = [3 1 0 2].

A=[3102].

The calculator conceptually begins by forming the symmetric matrix ATA.

Step 1 — Form ATA.

Formula: A^T = [3 0 1 2], A^T A = [3 0 1 2] [3 1 0 2] = [9 3 3 5].

AT=[3012],ATA=[3012][3102]=[9335].

Step 2 — Find the eigenvalues of ATA.

The characteristic polynomial is

Formula: det ⁡ (A^T ⁢ A ⁢ − ⁢ λ ⁢ I) = | 9 − λ 3 3 5 − λ | = (9 − λ)(5 − λ) − 9.

det(ATAλI)=|9λ335λ|=(9λ)(5λ)9.

Simplification gives

Formula: λ^2 − 14 λ + 36 = 0.

λ214λ+36=0.

The eigenvalues are approximately

Formula: λ_1 ≈ 10.6056, λ_2 ≈ 3.3944.

λ110.6056,λ23.3944.

Step 3 — Compute the singular values.

Using σ=λ, the singular values are approximately

Formula: σ_1 = sqrt(10.6056) ≈ 3.2566, σ_2 = sqrt(3.3944) ≈ 1.8424.

σ1=10.60563.2566,σ2=3.39441.8424.

Step 4 — Find the right singular vectors.

For each eigenvalue, solve (ATAλI)v=0 and normalize the resulting eigenvector v. The normalized eigenvectors become the columns of V.

Step 5 — Compute the left singular vectors.

For each nonzero singular value σi and right singular vector vi, compute

Formula: u_i = 1 / σ_i A v_i.

ui=1σiAvi.

The vectors form the columns of U. Entering 3, 1, 0, and 2 in the form produces the same singular values to the displayed precision. Small sign differences in singular vectors are valid because SVD factors are not unique.

Comparison of SVD with other matrix decompositions

For a real 2×2 matrix, SVD differs from eigenvalue, QR, and LU decompositions in both its requirements and the information it exposes.

How SVD compares with other decompositions for small real matrices
DecompositionFactorization formMatrix requirementsWhat it reveals
Singular Value DecompositionA=UΣVTAny real matrixOrthogonal input and output directions, stretching, numerical rank, and conditioning.
Eigenvalue decompositionA=PDP1A square, diagonalizable matrixInvariant directions and eigenvalue scaling; a real matrix may have complex eigenvalues or lack a full eigenbasis.
QR decompositionA=QRBroadly applicable, with form depending on dimensions and rankAn orthogonal basis and upper-triangular factor useful in least-squares and eigenvalue algorithms.
LU decompositionA=LUUsually square, with pivoting often requiredEfficient solution of linear systems, but less direct geometric information.

Assumptions and limitations of this 2×2 SVD calculator

This browser-based SVD calculator is designed for compact educational calculations, so its numerical scope and output precision are intentionally limited.

  • Matrix size: The tool accepts 2×2 matrices only, not larger or rectangular matrices.
  • Real entries: Inputs must be finite real numbers. Complex-valued matrices are not supported.
  • Floating-point arithmetic: Results use JavaScript number arithmetic and are rounded to four decimal places for display.
  • Near-zero values: Rank and infinite conditioning are decided using numerical tolerances. A matrix can be mathematically full rank while appearing rank-deficient at an extreme scale.
  • Repeated singular values: If both singular values are equal, many valid choices of singular vectors exist. Another SVD program may therefore return different vectors while representing the same matrix.
  • Extreme magnitudes: Entries whose products exceed the finite number range cannot be evaluated reliably.
  • No symbolic output: The calculator returns decimal approximations rather than exact radicals or symbolic eigenvectors.

For homework checks, demonstrations, and geometric exploration, these limits are usually reasonable. High-stakes engineering, statistical, or scientific work should use a tested numerical linear algebra library with scaling, robust tolerances, and error analysis.

Tips for applying 2×2 SVD results

Practical interpretation of a 2×2 SVD begins with the relative sizes of the singular values and then moves to the associated input and output directions.

  • Use the ratio σ1σ2 as a conditioning indicator when the smaller singular value is nonzero.
  • Compare the singular values with the scale of the matrix rather than judging a value as “small” in isolation.
  • Try a diagonal matrix first: its coordinate directions already align with the singular axes.
  • Try a rank-1 matrix such as two proportional rows. The smaller singular value should be zero or numerically close to zero.
  • Remember that changing the signs of paired singular vectors does not change the factorization.

Large separation between the singular values means one direction dominates. Nearly equal singular values mean the transformation behaves like uniform scaling combined with an orthogonal transformation, so the singular-vector orientation becomes less visually distinctive.

Applications of singular value decomposition in data and numerical analysis

The same singular value decomposition calculated here for a 2×2 matrix extends to large rectangular matrices used in data analysis, imaging, regression, optimization, and signal processing.

  • Principal component analysis: SVD helps identify directions associated with dominant variation in centered data.
  • Least squares and pseudoinverses: Singular values expose weak directions and support stable, tolerance-aware solutions.
  • Image compression: A low-rank approximation retains dominant singular components while reducing storage.
  • Signal processing: Dominant singular components can separate structured signal from weaker noise.
  • Dimensionality reduction: Truncating small singular values provides a lower-dimensional approximation to a dataset or linear operator.

The 2×2 setting makes the core idea visible: a unit circle becomes an ellipse whose principal radii and directions are precisely the information encoded by A=UΣVT.

Enter a real 2×2 matrix

Enter four finite real numbers. The calculator returns decimal approximations for U, Σ, and VT.

Enter matrix values.

Mini-game: match the SVD singular axes

This optional SVD mini-game turns the geometry of singular values into a visual matching challenge. Each round shows a ghost ellipse created from a hidden 2×2 transformation. Drag the two orthogonal handles until your ellipse matches the target before the timer expires. The blue handle controls the main singular direction and larger stretch σ1; the orange handle controls the smaller stretch σ2.

Score0
Time75.0s
Streak0
Round0
ModePreview
Best0
Submit

Match the singular axes

A ghost ellipse shows how a hidden 2×2 matrix transforms the unit circle. Drag the blue handle to choose the main singular direction and σ1. Drag the orange handle to tune σ2. Beat the buzzer or select Lock in early for bonus points.

Pointer or touch controls are supported. Keyboard controls: ← and → rotate, W and S change σ₁, I and K change σ₂, and Space or Enter locks the round.

Optional game: it teaches the same geometry that the calculator reports in U, Σ, and Vᵀ.

The session lasts about 75 seconds, with drift and blackout phases appearing later. Matching a nearly flat ellipse reinforces why a very small second singular value indicates a nearly rank-1 matrix.

Embed this calculator

Copy and paste the HTML below to add the 2×2 SVD Calculator – Compute U, Σ, and Vᵀ for a Matrix to your website.