Skip to content
Calculator Collection

Vector Dot Product Calculator

Compute the dot product of two 3D vectors as v1·v2 = v1x·v2x + v1y·v2y + v1z·v2z. Use it to measure projection, test orthogonality, or compute angles via the cosine formula.

Last updated: May 2026

Compare with similar

About this calculator

The dot product (also called scalar or inner product) of two vectors v1 = (v1x, v1y, v1z) and v2 = (v2x, v2y, v2z) is the scalar v1·v2 = v1x·v2x + v1y·v2y + v1z·v2z. Geometrically, v1·v2 = |v1| · |v2| · cos(θ), where θ is the angle between them — so the dot product equals zero exactly when the vectors are perpendicular (cos 90° = 0), and is positive when they point in roughly the same direction (acute angle), negative when opposite directions (obtuse angle), maximum when parallel (cos 0° = 1). The result has many uses: testing orthogonality, computing the angle between vectors via cos θ = (v1·v2)/(|v1|·|v2|), projecting one vector onto another (proj_v1 v2 = (v1·v2/|v1|²) · v1), computing work in physics (W = F·d), and as the building block of matrix multiplication. Edge cases: if either vector is the zero vector, the dot product is zero but the 'angle' is undefined — there is no direction to compare to. The dot product distributes over addition (a·(b+c) = a·b + a·c), is commutative (a·b = b·a), and scalar multiplication moves freely through it ((c·a)·b = c·(a·b)). For 2D vectors, simply set the z component to zero; the formula handles that case naturally.

How to use

Example 1 — two non-orthogonal 3D vectors. v1 = (3, 4, 5), v2 = (1, 0, 0). Inputs: v1x 3, v1y 4, v1z 5, v2x 1, v2y 0, v2z 0. Step 1: 3·1 = 3. Step 2: 4·0 = 0. Step 3: 5·0 = 0. Step 4: sum = 3 + 0 + 0 = 3. Verify: v2 is the unit vector along x, so the dot product equals v1's x component (3) ✓. The geometric interpretation: 3 is the length of the projection of v1 onto v2 (since |v2| = 1). Example 2 — orthogonality test. v1 = (1, 2, −3), v2 = (4, 1, 2). Inputs: v1x 1, v1y 2, v1z −3, v2x 4, v2y 1, v2z 2. Step 1: 1·4 = 4. Step 2: 2·1 = 2. Step 3: −3·2 = −6. Step 4: sum = 4 + 2 − 6 = 0. Verify: the dot product is zero, confirming v1 ⊥ v2; alternatively compute cos θ = 0/(|v1|·|v2|) = 0, giving θ = 90° ✓. Magnitudes: |v1| = √(1+4+9) = √14 ≈ 3.742, |v2| = √(16+1+4) = √21 ≈ 4.583. Both are nonzero, so the orthogonality is real and not a degeneracy.

Frequently asked questions

What's the difference between the dot product and the cross product?

The dot product takes two vectors and returns a scalar; the cross product (defined only in 3D) takes two vectors and returns another vector perpendicular to both. Dot product encodes angle and projection: v1·v2 = |v1|·|v2|·cos θ. Cross product encodes signed area and direction: |v1 × v2| = |v1|·|v2|·sin θ, with the result vector perpendicular to the plane of v1 and v2 (direction given by the right-hand rule). The two are complementary: dot product is zero for perpendicular vectors (cos 90° = 0), cross product is zero for parallel vectors (sin 0° = 0). In physics, dot product computes work (force · displacement) and power; cross product computes torque (force × lever arm), angular momentum, and magnetic force on a charge. In computer graphics, dot products test visibility (back-face culling) and compute shading; cross products compute surface normals. The two together with vector addition form the foundation of 3D vector algebra.

How do I use the dot product to find the angle between two vectors?

Solve the geometric formula v1·v2 = |v1|·|v2|·cos θ for the angle: θ = arccos((v1·v2) / (|v1|·|v2|)). Compute the dot product with this calculator, compute each vector's magnitude separately (|v| = √(x² + y² + z²)), divide, and take the arccosine — the result is in radians; multiply by 180/π for degrees. The dedicated 'Angle Between Vectors Calculator' in this category does all of this in one step. Edge cases: if either vector is the zero vector, the angle is undefined because there's no direction to compare. If floating-point round-off makes (v1·v2)/(|v1|·|v2|) slightly exceed 1 or fall below −1 (it shouldn't, mathematically, but numerically can), clamp to [−1, 1] before calling arccos to avoid NaN. The arccos range is [0°, 180°], which is the natural range for the angle between two vectors regardless of dimension.

How do I project one vector onto another?

The vector projection of v2 onto v1 is proj_v1 v2 = ((v1·v2) / (v1·v1)) · v1 = ((v1·v2) / |v1|²) · v1. The dot product appears twice: numerator measures how much of v2 lies along v1, denominator normalises by v1's squared length. The result is a vector in the direction of v1, of magnitude |v2|·cos θ (positive if v2 points roughly with v1, negative if against). The scalar projection (just the signed length) is (v1·v2) / |v1| — useful when you want a single number rather than a vector. Projection is the foundation of orthogonal decomposition: any vector v2 can be split into a component parallel to v1 (the projection) and a component perpendicular to v1 (v2 minus the projection). This split is the basis of the Gram-Schmidt process for orthogonalising a set of vectors, of least-squares regression (projecting the target vector onto the column space of the design matrix), and of Fourier analysis (projecting a signal onto basis functions).

What are the common mistakes when computing dot products?

The biggest mistake is confusing dot product with cross product or element-wise multiplication — dot product produces a scalar, element-wise produces a vector of the same length, cross product produces a vector perpendicular to both. The second is mismatching vector dimensions: dot product requires both vectors to have the same number of components, so a 2D and 3D vector cannot be dotted directly (pad the 2D with a zero z if you must). The third is sign errors when components are negative; the sum of signed products can flip sign easily with one slip. People also forget that the dot product is symmetric (a·b = b·a) and try to find an order that produces a 'better' answer; the order doesn't matter. For computing the angle, the most common slip is forgetting to divide by both magnitudes, which gives a value possibly outside [−1, 1] and breaks arccos. Finally, the dot product is zero for orthogonal vectors but also for zero vectors — distinguish these by checking magnitudes.

When should I not use this calculator?

Do not use it for vectors with more than three dimensions — for n-dimensional dot products (common in machine learning, data analysis, statistics), use a general n-dimensional dot-product tool or write Σ a_i · b_i directly. It is not appropriate for inner products other than the standard Euclidean dot product; in weighted, complex (with conjugation), or function-space inner products, the formula differs (e.g., for complex vectors, ⟨a, b⟩ = Σ a_i · conjugate(b_i)). Do not use it when one vector is the zero vector and you want an angle — angle is undefined in that case. It is not the right tool for cross products (use the dedicated cross-product calculator) or for matrix-vector or matrix-matrix multiplication — those are dot products of rows and columns but require a matrix-aware tool. Finally, for projecting onto subspaces of dimension > 1, you need orthogonal projection via QR decomposition or Gram-Schmidt, not a simple dot product.

Sources & references