Advanced

Gram-Schmidt Calculator — Orthonormal Basis

Enter two linearly independent 2-D vectors and the Gram-Schmidt process outputs an orthonormal basis — a pair of unit vectors that are mutually perpendicular.
e₁ · e₂ (dot product — should be 0)
0

A result of 0 confirms the output vectors are orthogonal

e₁ (x)
0.948683
e₁ (y)
0.316228
e₂ (x)
-0.316228
e₂ (y)
0.948683
|u₁| (norm of v₁)
3.1623
|u₂| (before normalizing)
3.1623
Projection scalar
1
v₁v₂Input vectors v₁ and v₂
e₁e₂Orthonormal basis e₁ and e₂ (perpendicular unit vectors)
Step by step
  1. 1

    Dot product v₂ · u₁

    2 × 3 + 4 × 1 = 10
  2. 2

    Norm² |u₁|²

    3² + 1² = 10
  3. 3

    Projection scalar

    10 ÷ 10 = 1
    Subtracting this scaled u₁ from v₂ gives the perpendicular component u₂.
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Gram-Schmidt converts two independent 2-D vectors v₁, v₂ into orthonormal vectors e₁, e₂. First take e₁ = v₁/|v₁|. Then subtract the component of v₂ along v₁ to get u₂, and normalize: e₂ = u₂/|u₂|. The result is two perpendicular unit vectors.

Formula
u₁ = v₁ • u₂ = v₂ − (v₂·u₁/|u₁|²)u₁ • e₁ = u₁/|u₁| • e₂ = u₂/|u₂|
How this is calculated

The Gram-Schmidt process converts any set of linearly independent vectors into an orthonormal basis — vectors that are perpendicular to each other and each have unit length. In 2-D, you supply two vectors v₁ and v₂.

The first basis vector is easy: take u₁ = v₁ and normalize it to e₁ = u₁/|u₁|. For the second, the algorithm removes the component of v₂ that lies along u₁ (its projection). The projection of v₂ onto u₁ equals (v₂ · u₁ / |u₁|²) × u₁. Subtracting this from v₂ gives u₂, which is guaranteed to be perpendicular to u₁. Normalizing u₂ gives e₂.

The method fails if v₁ is the zero vector or if v₁ and v₂ are parallel (linearly dependent), because there is no unique perpendicular direction to extract — the calculator flags both cases. The dot product e₁ · e₂ should be 0 (or within floating-point rounding of 0) after a successful computation, confirming orthogonality. This 2-D implementation extends naturally to N dimensions by repeating the projection-and-subtraction step for each new vector.

Frequently asked questions

It is an algorithm that turns any set of linearly independent vectors into an orthonormal set — vectors that are mutually perpendicular and each have a length (norm) of exactly 1. It works by iteratively projecting each vector onto the already-computed basis and subtracting that projection.

If v₁ and v₂ are parallel (one is a scalar multiple of the other), subtracting the projection of v₂ onto v₁ leaves the zero vector — you cannot form a unit vector from zero, and no second independent direction exists.

e₁ and e₂ form a new coordinate system. Any 2-D vector can be expressed as a linear combination of e₁ and e₂. Orthonormal bases simplify many calculations in linear algebra, including QR decomposition and solving least-squares problems.

Also known as

gram schmidt process
orthonormal basis calculator
gram schmidt orthogonalization
vector orthogonalization online
find orthogonal basis from vectors
linear algebra orthonormal basis
qr decomposition basis vectors

APA

TG we-Calculate Editorial Team. (2026). Gram-Schmidt Calculator — Orthonormal Basis [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/gram-schmidt-calculator

Chicago

TG we-Calculate Editorial Team. "Gram-Schmidt Calculator — Orthonormal Basis." TG we-Calculate. 2026. https://we-calculate.com/calculator/gram-schmidt-calculator.

IEEE

TG we-Calculate Editorial Team, "Gram-Schmidt Calculator — Orthonormal Basis," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/gram-schmidt-calculator

BibTeX

@misc{wecalculate_gram_schmidt_calculator, title = {Gram-Schmidt Calculator — Orthonormal Basis}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/gram-schmidt-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?