QR Decomposition Calculator

Your details

Number of rows in matrix A. Must be >= number of columns for QR to exist.
Number of columns in matrix A. Must be <= number of rows.
Enter m×n numbers left-to-right, top-to-bottom. Example for 2x2: "1 2 3 4". Commas or spaces are both fine.
How many decimal places to show in Q and R.
Q matrix (orthonormal)
[ 0.7071 0.2357 -0.6667 ] [ 0.0000 0.9428 0.3333 ] [ 0.7071 -0.2357 0.6667 ]

The orthonormal matrix Q such that Q^T Q = I

R matrix (upper triangular)[ 1.4142 1.4142 6.3640 ] [ 0.0000 4.2426 4.0069 ] [ 0.0000 0.0000 3.6667 ]
Max reconstruction error |A - QR|0
Orthogonality error |Q^T Q - I|0
Matrix dimensionsA is 3x3, Q is 3x3, R is 3x3
StatusDecomposition successful
Reconstruction error0
Orthogonality error0

A = QR factored successfully (3x3 matrix).

  • Q is a 3x3 matrix with orthonormal columns: each column has unit length and all columns are mutually perpendicular.
  • R is a 3x3 upper triangular matrix: all entries below the main diagonal are zero.
  • Verification passed: Q times R exactly reproduces A (reconstruction error < 1e-10).
  • Orthogonality error of Q^T Q vs I is 2.78e-16.

Next stepTo solve a least-squares problem Ax = b, use x = R^(-1) Q^T b. To find eigenvalues, apply the QR algorithm iteratively (A_{k+1} = R_k Q_k).

= Powered by OnlyCalculators