Enter any matrix, choose a QR method, inspect every calculation, verify orthogonality, solve least-squares systems, and export accurate results instantly with confidence every time.
A QR decomposition writes a matrix as A = QR. Matrix Q has orthonormal columns, while R is upper triangular. This factorization supports stable solving, projection, and least-squares analysis.
Gram–Schmidt subtracts projections before normalizing each new basis vector. Householder reflections remove entries below each diagonal position. Givens rotations eliminate one selected entry at a time.
Select matrix dimensions, then enter every matrix value carefully. Choose a method, form, precision, and optional pivoting setting. Submit the form to inspect matrices, checks, and steps.
Enable linear solving when vector b is available. The calculator computes Qᵀb and performs back substitution. Review residuals before relying on a least-squares solution.
| Example | Matrix A | Suggested method | Purpose |
|---|---|---|---|
| Classic 3×3 | [[12, -51, 4], [6, 167, -68], [-4, 24, -41]] | Householder | Produces a well-known exact-style QR result. |
| Tall 4×2 | [[1, 1], [1, 2], [1, 3], [1, 4]] | Modified Gram–Schmidt | Demonstrates least-squares line fitting. |
| Nearly dependent | [[1, 1.000001], [2, 2.000001], [3, 3.000001]] | Householder with pivoting | Highlights stability and rank warnings. |
It factors A into Q and R. Q is orthogonal or column-orthonormal. R is upper triangular or upper trapezoidal.
Householder reflections are usually stable and efficient. Modified Gram–Schmidt is useful for teaching. Givens rotations suit sparse or incremental problems.
Reduced QR stores only necessary Q columns. Its R matrix contains matching essential rows. This saves memory for tall matrices.
Pivoting reorders columns by numerical importance. It improves rank detection and stability. The permutation matrix records that new order.
The calculator evaluates QᵀQ. An identity result confirms ideal orthogonality. Small numerical errors are normal in floating-point arithmetic.
Pivoted QR factors AP instead of A. Therefore A equals QRPᵀ. The calculator displays both reconstruction forms.
Yes, QR supports least-squares solutions. It projects b using Qᵀb. Back substitution then solves the triangular system.
Very small diagonal entries in R indicate dependence. The calculator estimates rank using numerical tolerance. Pivoting usually makes this diagnosis clearer.
Fractions are rational approximations of floating-point values. Irrational QR entries cannot be represented exactly. Increase precision when greater detail is needed.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.