Logo

MonoCalc

/

Vector Dot Product Calculator

Geometry

Vector Mode

Vector A

X

Y

Vector B

X

Y

Decimal Precision

Dot Product (A · B)

11

Magnitude of A

5

Magnitude of B

2.2361

Angle Between Vectors

10.3048°

0.1799 rad

Perpendicular?

No

Scalar Projection of A onto B

4.9193

About This Tool

Vector Dot Product Calculator – Scalar Product, Angle, and Projection

The dot product (also called the scalar product) is one of the two fundamental ways to multiply vectors, alongside the cross product. Unlike vector addition or the cross product, the dot product of two vectors always returns a single scalar number rather than another vector. This calculator computes the dot product of two vectors in 2D or 3D space, along with the magnitude of each vector, the angle between them, a perpendicularity check, and the scalar projection of one vector onto the other.

The Dot Product Formula

For two vectors A and B, the dot product is calculated by multiplying corresponding components and summing the results:

  • 2D: A·B = Ax·Bx + Ay·By
  • 3D: A·B = Ax·Bx + Ay·By + Az·Bz

For example, if A = (3, 4) and B = (1, 2), then A·B = 3×1 + 4×2 = 11. In 3D, if A = (1, 2, 3) and B = (4, 5, 6), then A·B = 1×4 + 2×5 + 3×6 = 32.

Magnitude of a Vector

The magnitude (or length) of a vector is derived from the Pythagorean theorem: |A| = √(Ax² + Ay² [+ Az²]). Both magnitudes are required to compute the angle between the vectors and the scalar projection, so the calculator always displays|A| and |B| alongside the dot product.

Finding the Angle Between Two Vectors

The dot product is closely tied to the angle θ between two vectors through the identity A·B = |A|·|B|·cos θ. Rearranging for θ gives:

θ = arccos( (A·B) / (|A|·|B|) )

For instance, A = (1, 0) and B = (0, 1) gives A·B = 0, so cos θ = 0 and θ = 90°. The calculator reports this angle in both degrees and radians.

Perpendicularity Check

Two vectors are perpendicular (orthogonal) exactly when their dot product equals zero, since cos(90°) = 0. This calculator automatically flags perpendicular vector pairs with a badge, which is a quick way to verify orthogonality without manually solving for the angle.

Scalar Projection of A onto B

The scalar projection measures how much of vector A points in the direction of vector B. It is calculated as:

proj_B(A) = (A·B) / |B|

For example, with A = (3, 4) and B = (1, 0), the dot product is 3 and |B| = 1, so the scalar projection of A onto B is 3. This concept underlies vector decomposition, work calculations in physics, and shadow/lighting computations in computer graphics.

Handling the Zero Vector

If either vector A or vector B has a magnitude of zero (all components are zero), the angle and scalar projection become mathematically undefined because the formulas require dividing by |A|·|B| or |B|. The calculator detects this condition and displays a clear warning instead of an incorrect or misleading value, while still reporting the dot product (which is always 0 in that case) and the magnitudes.

Real-World Applications

  • Physics — work done by a force: Work equals the dot product of the force vector and the displacement vector, W = F·d, capturing only the component of force in the direction of motion.
  • Computer graphics and game engines: Dot products determine lighting intensity (via the angle between a surface normal and a light direction) and are used extensively in collision detection and camera view calculations.
  • Engineering projections: Engineers use scalar projections to resolve forces or velocities along a specific axis or direction of interest.
  • Machine learning: Dot products underlie cosine similarity, a common metric for comparing feature vectors and embeddings.

Using This Calculator

Toggle between 2D and 3D mode at the top, enter the components of vector A and vector B, and results update live as you type. Expand the Step-by-Step Calculation panel to see the substituted formula, adjust decimal precision from 0 to 10 places, and use the copy or share buttons to save your results or send a pre-filled link to a colleague or classmate.

Frequently Asked Questions

Is the Vector Dot Product Calculator free?

Yes, Vector Dot Product Calculator is totally free :)

Can I use the Vector Dot Product Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Vector Dot Product Calculator?

Yes, any data related to Vector Dot Product Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is the dot product of two vectors?

The dot product (also called the scalar product) of two vectors A and B is a single number computed as A·B = Ax·Bx + Ay·By (+ Az·Bz in 3D). Unlike vector addition, the result is a scalar, not a vector, and it captures how much the two vectors point in the same direction.

How does this calculator work?

Choose 2D or 3D mode, enter the X, Y (and Z) components of vectors A and B, and the calculator instantly computes the dot product, the magnitude of each vector, the angle between them, whether they are perpendicular, and the scalar projection of A onto B — along with a step-by-step breakdown of the formula.

How is the angle between two vectors calculated?

The angle θ is derived by rearranging the dot product formula: θ = arccos((A·B) / (|A|·|B|)). The calculator computes this automatically and displays the result in both degrees and radians.

What does it mean when the dot product is zero?

A dot product of zero means the two vectors are perpendicular (orthogonal) to each other, since cos(90°) = 0. The calculator flags this case with a clear "Perpendicular" badge whenever A·B evaluates to zero.

What happens if one of the vectors is a zero vector?

If either vector has zero magnitude (all components are zero), the angle and scalar projection are mathematically undefined because you cannot divide by a zero magnitude. The calculator detects this case and shows a warning instead of a misleading number.

How accurate are the results?

Calculations use IEEE 754 double-precision floating-point arithmetic, which provides roughly 15–16 significant digits of accuracy — more than sufficient for academic, engineering, and graphics programming use cases.