Maths & numbers

QR decomposition

Factor a small matrix into an orthonormal basis and upper-triangular coefficients.

QR decomposition
Esc to restore

Your inputs

Up to 6 × 6. Entries separated by spaces or commas; finite magnitudes from 10⁻¹² to 10¹², or zero.

Results update as you type. Larger files run when you press Update result.

Your result

LOCAL & PRIVATE

Your result will appear here.

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Computes economy QR using modified Gram–Schmidt with a second orthogonalisation pass. Requires rows≥columns and numerically independent columns; up to 6 × 6. Returns Q and R with A≈QR and QᵀQ≈I. Rejects column norms at or below 10⁻¹² × max(1, largest absolute input entry); no column pivoting is performed.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Matrix: one row per line
1, 1
1, 0
0, 1

Example result

Example result
FactorRowC1C2
Q10.7071067811870.408248290464
Q20.707106781187-0.408248290464
Q300.816496580928
R11.414213562370.707106781187
R201.22474487139

Economy QR: A=Q×R and transpose(Q)×Q=I. Modified Gram–Schmidt with a second orthogonalisation pass; dependent columns are rejected.