Dot Product Calculator
Compute the dot product and angle between 2D or 3D vectors instantly — essential for linear algebra, physics, and engineering.
Select the vector dimension, enter the components of both vectors, and get the dot product, angle, and magnitudes in one click.
Dot Product Calculator
Compute the dot product and angle between 2D or 3D vectors instantly — essential for linear algebra, physics, and engineering.
About the dot product calculator
The dot product, also called the scalar product or inner product, is one of the most fundamental operations in vector mathematics. Given two vectors a and b, their dot product is the sum of the products of corresponding components. For 2D vectors a = (a₁, a₂) and b = (b₁, b₂), the formula is a·b = a₁b₁ + a₂b₂. For 3D vectors a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), the formula extends to a·b = a₁b₁ + a₂b₂ + a₃b₃. Unlike the cross product, the result is a single real number — a scalar — which is why the dot product is also called the scalar product.
The geometric interpretation of the dot product is equally important: a·b = |a| × |b| × cos(θ), where |a| and |b| are the magnitudes of the respective vectors and θ is the angle between them. This relationship allows you to compute the angle between any two vectors as θ = arccos(a·b / (|a| × |b|)), provided neither vector is the zero vector. The dot product calculator uses this formula to display the angle in degrees alongside the numerical dot product value.
The sign and magnitude of the dot product carry useful information. When the dot product is zero, the vectors are perpendicular (orthogonal), meaning they point in directions that form a 90° angle. A positive dot product indicates an acute angle (less than 90°) between the vectors, while a negative dot product indicates an obtuse angle (greater than 90°). When two vectors are parallel and point in the same direction, their dot product equals the product of their magnitudes.
Applications of the dot product span many fields. In physics, work is calculated as W = F·d, the dot product of force and displacement vectors. In computer graphics, the dot product is used in lighting calculations (Lambert's cosine law) to determine how brightly a surface should be lit. In machine learning, the dot product underlies the computation of similarity between feature vectors and is central to operations in neural networks. In signal processing, correlation of two signals is computed using dot products over time windows.
The dot product calculator also computes the magnitudes of both input vectors. The magnitude (Euclidean norm) of a vector is the square root of the sum of squared components: |a| = √(a₁² + a₂²) for 2D or |a| = √(a₁² + a₂² + a₃²) for 3D. A unit vector has magnitude 1, and the dot product of two unit vectors equals the cosine of the angle between them directly. If you need to normalize a vector (convert it to a unit vector), divide each component by the vector's magnitude.
Understanding the dot product is essential for anyone studying linear algebra, multivariable calculus, physics, or computer science. This calculator provides immediate numerical results along with the vector relationship classification, making it useful for homework, exam preparation, physics problem-solving, and engineering applications.
Dot product calculator examples
Four representative vector pairs showing 2D and 3D dot products, perpendicular vectors, and unit vector cases.
| Vectors | Dot Product | Angle / Notes |
|---|---|---|
| a = (3, 4), b = (1, 2) — 2D | 11 | a·b = 3×1 + 4×2 = 11. |a| = 5, |b| = √5 ≈ 2.236. Angle ≈ 10.3°. Vectors point in similar directions. |
| a = (1, 0), b = (0, 1) — 2D | 0 | Dot product is zero: the x-axis and y-axis unit vectors are perpendicular (90°). A zero dot product always means orthogonality. |
| a = (2, 1, 3), b = (1, 4, 2) — 3D | 12 | a·b = 2×1 + 1×4 + 3×2 = 2+4+6 = 12. |a| = √14 ≈ 3.742, |b| = √21 ≈ 4.583. Angle ≈ 45.6°. |
| a = (0.6, 0.8), b = (0.8, 0.6) — 2D unit vectors | 0.96 | Both vectors have magnitude 1. Dot product equals cos(θ) = 0.96 directly, so angle ≈ 16.3°. |
How to use the dot product calculator
- Select the vector dimension: choose 2D for two-component vectors or 3D for three-component vectors.
- Enter the X and Y components of the first vector (a) and, if using 3D mode, the Z component as well.
- Enter the X, Y (and Z) components of the second vector (b).
- Click Calculate Dot Product. The result panel shows the scalar dot product, the angle between the vectors in degrees, both magnitudes, and the cosine of the angle.
- Click Reset to clear all fields and start a new calculation, or edit any component to update the result.
Dot product calculator FAQ
What does a dot product of zero mean?
A dot product of zero means the two vectors are orthogonal, i.e., they are perpendicular to each other. The angle between them is exactly 90°. This property is widely used in mathematics and physics to test whether two directions are at right angles.
Can the dot product be negative?
Yes. A negative dot product means the angle between the two vectors is greater than 90° (obtuse). Geometrically, the vectors point more away from each other than toward each other. The most negative value occurs when the vectors are antiparallel (pointing in exactly opposite directions), where the dot product equals −|a||b|.
What is the difference between the dot product and the cross product?
The dot product yields a scalar (single number) and measures how much two vectors point in the same direction. The cross product yields a vector perpendicular to both inputs and measures how much they point in different directions. The dot product works in any number of dimensions; the cross product is defined only in 3D (and 7D).
How is the dot product used to find the angle between vectors?
Use the formula θ = arccos(a·b / (|a| × |b|)). Compute the dot product, divide by the product of the two magnitudes to get the cosine of the angle, then take the inverse cosine. The calculator performs all three steps automatically and returns the angle in degrees.
What happens when one vector is the zero vector?
The dot product with the zero vector is always zero regardless of the other vector. However, the angle between a zero vector and any other vector is undefined because the zero vector has no direction. The calculator detects this case and displays an appropriate message.
Is the dot product commutative?
Yes. The dot product is commutative: a·b = b·a for all vectors. Swapping the two vectors does not change the scalar result. This follows directly from the component formula: the sum of component products does not depend on order.