How this calculation works
Process input columns in order. Subtract their projections onto the already retained orthogonal vectors. Keep a nonzero residual as the next direction; skip a zero residual because it adds no direction. The result is an exact orthogonal basis, without unit-length normalization. Divide each retained nonzero residual by its Euclidean length to display an approximate orthonormal basis. Exact rational vectors and normalized decimal approximations are kept separate.
uⱼ = vⱼ − Σᵢ<ⱼ [(vⱼ · uᵢ)/(uᵢ · uᵢ)] uᵢA worked example
For columns (1,1) and (1,0), the retained vectors are (1,1) and (1/2,−1/2). Their dot product is zero and their squared norms are 2 and 1/2.
Good to know
Exact rational matrices up to 6 × 6. Entries are bounded to ±1,000,000, integer fraction denominators to 1,000,000 and decimal input to 6 places. Intermediate fractions have a size limit. No complex entries, symbolic expressions, measurement uncertainty or numerical-conditioning analysis. Ordered vectors are entered as matrix columns.
Reference: Harvard University: Gram–Schmidt orthogonalization (opens in a new tab) ↗
Orthogonal and orthonormal are different output requirements
The 2×2 SVD calculator performs a different factorization, separating orthogonal factors and nonnegative singular values and checking reconstruction.
Orthogonal vectors have zero pairwise dot products. Orthonormal vectors additionally have unit length. The tool first retains exact rational orthogonal residuals, then divides each retained vector by its Euclidean length to provide a separate numerical orthonormal approximation.
A vector such as (1,1) has squared length two, so its unit version is (1/√2,1/√2). Those normalized components need not be rational even when all input coordinates are rational. Printing approximate unit vectors as if they were exact fractions would hide that distinction.
Dependent vectors add no new direction
Each input column is processed in order and has its projections onto the retained directions removed. If the residual is zero, that input was already in the span of earlier retained columns and is skipped. Dividing that zero residual by its length would be undefined.
Input order affects which orthogonal basis is produced, even though the retained span is the same. The basis and dimension finder can separately identify independent original columns. This real Euclidean model does not introduce complex conjugation, statistical uncertainty or a guarantee of stability for measured nearly dependent data.
A few questions, answered
Does the page now include unit vectors?
Yes. Exact unnormalized vectors and approximate normalized vectors are displayed in separate columns.
Why skip a dependent column?
Its residual is zero, so it adds no independent direction and cannot be normalized.
Are normalized components always exact rational numbers?
No. Their lengths can involve irrational square roots, so the normalized display is approximate.