Gram-Schmidt Calculator

Orthonormalize a set of vectors.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter vectors, one per row, to turn them into an orthonormal set. (1, 1, 0) and (1, 0, 1) become (0.707107, 0.707107, 0) and (0.408248, −0.408248, 0.816497).

How to use

1
Step 1
Type each vector as a row of numbers.
2
Step 2
Press Calculate.
3
Step 3
Read the orthonormal vectors, one per row.

How it works

Keep the first vector, scaled to length 1. For each next vector, subtract its projections onto the ones already kept, then scale the remainder to length 1. The results are perpendicular, with unit length, and span the same space.

uₖ = vₖ − Σ proj_{uⱼ}(vₖ),  eₖ = uₖ ÷ |uₖ|

Worked example

Two vectors in the plane

Input
(3, 1) and (2, 2)
Output
(0.948683, 0.316228) and (−0.316228, 0.948683)
Walkthrough
|(3, 1)| = √10, giving the first vector. Removing its component from (2, 2) leaves a vector perpendicular to it, scaled to length 1.

Limitations

  • The input vectors must be linearly independent; a dependent vector leaves nothing to normalise.
  • All vectors need the same number of components.

Questions

What does Gram-Schmidt do?
It builds perpendicular unit vectors that span the same space as your inputs.
What is the orthonormal set for (3,1) and (2,2)?
(0.948683, 0.316228) and (−0.316228, 0.948683).
Is the result unique?
It depends on the input order. Reordering the vectors gives a different orthonormal set.

Features

  • Unit-length results
  • Any number of vectors
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Essence of linear algebra preview

    3Blue1Brown

    Big-picture linear algebra for matrix-related calculators.

    Watch on YouTube
  • Solving a consecutive integer problem

    Khan Academy

    Word-problem setup that feeds equation tools.

    Watch on YouTube
  • Math is Fun

    Math is Fun

    Clear explainers that pair well with calculator-style tools.

  • Quadratic Equations

    Math is Fun

    Factoring and formula methods next to quadratic solvers.