Gram-Schmidt Calculator

Quick answer

The Gram–Schmidt calculator turns up to four vectors (with up to four coordinates) into an orthogonal set and an orthonormal basis of the space they span.

Orthonormal basis
e₁ = (0.707107, 0.707107, 0) e₂ = (0.408248, −0.408248, 0.816497) e₃ = (−0.57735, 0.57735, 0.57735)
Orthogonal vectors
u₁ = (1, 1, 0) u₂ = (1/2, −1/2, 1) u₃ = (−2/3, 2/3, 2/3)
Steps
u₁ = (1, 1, 0), ‖u‖ = 1.4142136 u₂ = (0.5, −0.5, 1), ‖u‖ = 1.2247449 u₃ = (−0.666667, 0.666667, 0.666667), ‖u‖ = 1.1547005
Dimension of the span
3

Orthonormal bases simplify projections, least squares and coordinate changes. The Gram–Schmidt process builds one from any set of vectors and is the basis of the QR decomposition.

How to use the Gram-Schmidt Calculator

  1. Number of vectors
  2. Number of coordinates
  3. v₁: x
  4. v₁: y
  5. v₁: z
  6. v₁: w
  7. v₂: x
  8. v₂: y
  9. v₂: z
  10. v₂: w
  11. v₃: x
  12. v₃: y
  13. v₃: z
  14. v₃: w
  15. v₄: x
  16. v₄: y
  17. v₄: z
  18. v₄: w

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Each vector has its components along the previous orthonormal vectors removed; what is left is normalised. Vectors that are combinations of earlier ones leave nothing and are dropped.

Formula

u₁ = v₁, uₖ = vₖ − Σⱼ (vₖ·eⱼ) eⱼ, eₖ = uₖ / ‖uₖ‖

Worked example

Inputs — Number of vectors: 3; Number of coordinates: 3; v₁: x: 1; v₁: y: 1; v₁: z: 0; v₂: x: 1; v₂: y: 0; v₂: z: 1; v₃: x: 0; v₃: y: 1; v₃: z: 1.
Results — Orthonormal basis = e₁ = (0.707107, 0.707107, 0)
e₂ = (0.408248, −0.408248, 0.816497)
e₃ = (−0.57735, 0.57735, 0.57735)
; Orthogonal vectors = u₁ = (1, 1, 0)
u₂ = (1/2, −1/2, 1)
u₃ = (−2/3, 2/3, 2/3); Steps = u₁ = (1, 1, 0), ‖u‖ = 1.4142136
u₂ = (0.5, −0.5, 1), ‖u‖ = 1.2247449
u₃ = (−0.666667, 0.666667, 0.666667), ‖u‖ = 1.1547005; Dimension of the span = 3.

Key terms

Orthonormal
Mutually perpendicular unit vectors.

Frequently asked questions

What does Gram–Schmidt do?

Converts a set of vectors into an orthonormal set with the same span.

What if the vectors are dependent?

Dependent vectors produce zero and are discarded.

Is the result unique?

It depends on the order of the input vectors.

Is it numerically stable?

The modified Gram–Schmidt version (used here) is more stable than the classical one.

Sources

  1. Wolfram MathWorld – Gram-Schmidt orthonormalization
  2. MIT OpenCourseWare – 18.06 Linear Algebra (Gilbert Strang)
  3. Jim Hefferon – Linear Algebra (free textbook)

Cite this calculator

Speedy Calculator. (2026). Gram-Schmidt Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/gram-schmidt/