Turn 2–3 vectors into an orthonormal basis with the Gram–Schmidt steps shown.
Vectors live in 3D space (x, y, z). The result is an orthonormal set: each vector has length 1 and is perpendicular to the others.
first orthonormal vector e1
How to use this tool
Type two or three vectors in 3D, one component per box. Switch to 3 vectors if you have a third.
The vectors must not be multiples of each other — a dependent set has no orthonormal basis and the calculator says so.
The orthonormal vectors e1, e2 (and e3) appear in the results, each of length 1 and perpendicular to the rest.
The step list shows each projection subtracted and each normalisation, so you can reproduce the working by hand.
Formula & worked example
For v1 = (1, 1, 0) and v2 = (1, 0, 1): e1 = (0.7071, 0.7071, 0). Subtracting the projection of v2 onto e1 leaves (0.5, −0.5, 1), which normalises to e2 = (0.4082, −0.4082, 0.8165). Their dot product is 0, as required.
Limitations — read this before you rely on it
This calculator works in 3D only (vectors with x, y, z components). It uses floating-point arithmetic, so components are rounded to 4 decimals and tiny residuals (~10⁻¹⁶) may appear in dot products. A dependent or zero vector set cannot be orthogonalised and returns an error rather than a fabricated basis.
Frequently asked questions
Ortho = perpendicular, normal = unit length. An orthonormal set is a set of mutually perpendicular vectors that each have length 1.
Orthonormal bases simplify projections, least-squares fits, QR decomposition and computer graphics — coordinates in such a basis are just dot products.
Then one vector adds no new direction, and Gram–Schmidt hits a zero vector when it tries to remove all known directions. Replace the dependent vector.
Yes — e1 always points along v1, so reordering the inputs gives a different (but equally valid) orthonormal basis for the same space.
In 3D space at most 3 vectors can be independent, so a fourth would always be dependent. Higher dimensions need a general implementation.
