Vector Projection Calculator

Projecting one vector onto another finds the component of the first that lies along the direction of the second, like the shadow a vector casts on a line. This calculator takes two 3D vectors a and b and returns the scalar projection (the signed length of a along b), the full projection vector, and the dot product that drives the calculation. Vector projection underlies orthogonal decomposition, least-squares fitting, work in physics, and the Gram-Schmidt process. Enter the components of each vector to see the result.

0.00
0.00
0.00
0.00

Vector projection formula

a.b = ax*bx + ay*by + az*bz
scalar proj = (a.b) / |b|
vector proj = ( (a.b) / (b.b) ) * b
|b| = sqrt(bx^2 + by^2 + bz^2)
undefined when b is the zero vector

The scalar projection is the dot product divided by the magnitude of b. The vector projection scales the direction of b by the ratio of the dot product to b dotted with itself.

Notes on vector projection

  • Enter each vector as three comma-separated components.
  • The scalar projection is signed: negative means a points away from b.
  • The vector projection always points along b (or opposite to it).
  • Projection onto the zero vector is undefined.
  • Subtracting the projection from a leaves the component orthogonal to b.

Vector projection: frequently asked questions

What is a vector projection?

The projection of vector a onto vector b is the component of a that lies along the direction of b. It is the shadow that a casts onto the line through b, and it is itself a vector pointing along b.

What is the formula for vector projection?

The projection of a onto b equals (a dot b) divided by (b dot b), all times the vector b. The scalar projection, the signed length, equals (a dot b) divided by the magnitude of b.

What is the difference between scalar and vector projection?

The scalar projection is a single signed number giving the length of a along b. The vector projection multiplies that direction by the unit vector of b, producing a full vector that points along b with that length.

What does a negative scalar projection mean?

A negative scalar projection means the component of a along b points in the opposite direction to b. This happens when the angle between a and b is greater than ninety degrees, making their dot product negative.

What if vector b is the zero vector?

Projection onto the zero vector is undefined because b has no direction and b dot b is zero, which would require dividing by zero. This calculator returns n/a when b is the zero vector.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.