Vector Dot Product and Cross Product Calculator

Vector Dot Product and Cross Product Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

a·b=∑i=1naibi\mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^{n} {a_i}\,{b_i}
Show calculation steps (2)
  1. Cross Product (3D)

    a×b=(a2b3−a3b2a3b1−a1b3a1b2−a2b1)\mathbf{a} \times \mathbf{b} = \begin{pmatrix} {a_2}\,{b_3} - {a_3}\,{b_2} \\ {a_3}\,{b_1} - {a_1}\,{b_3} \\ {a_1}\,{b_2} - {a_2}\,{b_1} \end{pmatrix}

    Cross product for two 3D vectors a and b

  2. Angle Between Vectors

    θ=arccos⁡(a·b‖a‖‖b‖)\theta = \arccos\!\left( \frac{\mathbf{a} \cdot \mathbf{b}}{\lVert \mathbf{a} \rVert \, \lVert \mathbf{b} \rVert} \right)

    Angle from the dot product divided by the product of magnitudes

Usage stats

Advertisement

Results

Inner product a·b
-1
scalar
Cross product a×b ( 0, -0, 1 )
Magnitude |a×b| 1
Angle between a and b (degrees) 135°
Angle between a and b (radians) 2.35619449019234

Report an error on this page

What this calculator does

This tool computes two fundamental vector operations: the inner (dot) product and the cross product of two vectors a and b. The dot product returns a single scalar number, while the cross product returns a new 3-dimensional vector that is perpendicular to both inputs. The calculator also reports the magnitude of the cross product and the angle between the two vectors.

How to use it

Enter the components of vector a and vector b as comma-separated numbers (for example 1, 2, 3). For the dot product, a and b may have any matching dimension \(n\). For the cross product, both vectors must have exactly three components. Choose how many significant digits to display from the dropdown; this affects only the displayed result, not the underlying computation.

Two 3D vectors and their cross product shown as a perpendicular arrow with the right-hand rule
The cross product yields a vector perpendicular to both inputs, following the right-hand rule.

The formulas explained

The dot product multiplies matching components and sums them: $$\mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^{n} a_i\,b_i$$ A result of zero means the vectors are orthogonal (perpendicular). The cross product produces the vector $$\mathbf{a} \times \mathbf{b} = \begin{pmatrix} a_2\,b_3 - a_3\,b_2 \\ a_3\,b_1 - a_1\,b_3 \\ a_1\,b_2 - a_2\,b_1 \end{pmatrix}$$ The angle is found from $$\theta = \arccos\!\left( \frac{\mathbf{a} \cdot \mathbf{b}}{\lVert \mathbf{a} \rVert \, \lVert \mathbf{b} \rVert} \right)$$ which requires both vectors to be non-zero.

Advertisement

Worked example

Let a = (1, 2, 3) and b = (4, 5, 6). The dot product is $$1\times 4 + 2\times 5 + 3\times 6 = 4 + 10 + 18 = 32$$ The cross product components are \(c_1 = 2\times 6 - 3\times 5 = -3\), \(c_2 = 3\times 4 - 1\times 6 = 6\), \(c_3 = 1\times 5 - 2\times 4 = -3\), giving \(\mathbf{a}\times\mathbf{b} = (-3, 6, -3)\). Its magnitude is $$\sqrt{9+36+9} = \sqrt{54} \approx 7.3485$$

Two vectors sharing an origin with the angle between them marked, showing dot product as projection
The dot product relates to the angle between two vectors and the projection of one onto the other.

Interpreting the Dot Product, Cross Product and Angle

For two vectors \(\mathbf{a}\) and \(\mathbf{b}\) separated by an angle \(\theta\), the dot product can be written as \(\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}|\,|\mathbf{b}|\cos\theta\). The calculator also gives the angle as \(\theta = \arccos\left(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}\right)\), which always lies between 0° and 180°.

Reading the dot product

  • Positive: the angle is under 90° (the vectors point broadly the same way).
  • Negative: the angle is over 90° (they point broadly opposite ways).
  • Zero: the vectors are orthogonal (perpendicular), or one of them is the zero vector.
  • Parallel: the dot product equals +1 times the product of the magnitudes, because \(\cos 0^\circ = 1\).
  • Antiparallel: the dot product equals -1 times the product of the magnitudes, because \(\cos 180^\circ = -1\).

Reading the cross product

  • The magnitude is \(|\mathbf{a}\times\mathbf{b}| = |\mathbf{a}|\,|\mathbf{b}|\sin\theta\). This is the area of the parallelogram spanned by the two vectors.
  • A zero cross product means the vectors are parallel or antiparallel, or one of them is the zero vector.
  • The direction is perpendicular to both vectors and follows the right-hand rule: curl your fingers from \(\mathbf{a}\) toward \(\mathbf{b}\) and your thumb points along \(\mathbf{a}\times\mathbf{b}\).
  • The cross product is anticommutative: \(\mathbf{a}\times\mathbf{b} = -(\mathbf{b}\times\mathbf{a})\).
  • The standard cross product is defined for 3-dimensional vectors. The dot product works in any matching dimension.

The dot product and the cross product are linked by \((\mathbf{a}\cdot\mathbf{b})^2 + |\mathbf{a}\times\mathbf{b}|^2 = |\mathbf{a}|^2|\mathbf{b}|^2\) in three dimensions.

Comparing Common Vector Configurations

These 3-dimensional cases show how the dot product, cross product and angle behave together.

Configuration a b Dot product Cross product Cross magnitude Angle
Parallel (1, 0, 0) (2, 0, 0) 2 (0, 0, 0) 0 0°
Perpendicular (1, 0, 0) (0, 1, 0) 0 (0, 0, 1) 1 90°
Antiparallel (1, 0, 0) (-1, 0, 0) -1 (0, 0, 0) 0 180°
Obtuse (1, 0, 0) (-1, 1, 0) -1 (0, 0, 1) 1 135°

Check of the obtuse row: the dot product is \(1\cdot(-1) + 0\cdot 1 + 0\cdot 0 = -1\). The magnitudes are \(|\mathbf{a}| = 1\) and \(|\mathbf{b}| = \sqrt{2}\). Then \(\cos\theta = \frac{-1}{1\cdot\sqrt{2}} \approx -0.7071\), so \(\theta = 135^\circ\). The cross product is \((0\cdot 0 - 0\cdot 1,\; 0\cdot(-1) - 1\cdot 0,\; 1\cdot 1 - 0\cdot(-1)) = (0, 0, 1)\).

Advertisement

Key Terms in Vector Products

Vector
An ordered list of numbers that represents a quantity with both magnitude and direction, such as \((3, -1, 2)\).
Component
One entry of a vector, for example \(a_i\), the value along axis \(i\).
Dimension
The number of components in a vector. The dot product needs both vectors to have the same dimension.
Scalar product (dot or inner product)
The single number \(\sum_{i=1}^{n} a_i b_i\), equal to \(|\mathbf{a}||\mathbf{b}|\cos\theta\).
Vector product (cross product)
For 3D vectors, a new vector perpendicular to both inputs. Its components are \((a_2b_3 - a_3b_2,\; a_3b_1 - a_1b_3,\; a_1b_2 - a_2b_1)\), and its length is \(|\mathbf{a}||\mathbf{b}|\sin\theta\).
Magnitude (norm)
The length of a vector: \(|\mathbf{a}| = \sqrt{\sum_{i=1}^{n} a_i^2}\).
Orthogonal
Two vectors are orthogonal when their dot product is zero, meaning they meet at 90°.
Parallel
Two vectors are parallel when one is a scalar multiple of the other. A positive multiple gives 0°, a negative multiple (antiparallel) gives 180°. In 3D the cross product is then the zero vector.
Right-hand rule
A convention for the direction of \(\mathbf{a}\times\mathbf{b}\): curl the fingers of your right hand from \(\mathbf{a}\) toward \(\mathbf{b}\), and the thumb points along the result.
Unit vector
A vector of magnitude 1. Any nonzero vector can be normalized as \(\hat{\mathbf{a}} = \mathbf{a}/|\mathbf{a}|\).
Projection
The component of \(\mathbf{a}\) along \(\mathbf{b}\). The scalar projection is \(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|}\), and the vector projection is \(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}\).

FAQ

Why is my cross product undefined? The cross product is only defined for 3-dimensional vectors. Make sure both a and b have exactly three components.

Why is the dot product undefined? The dot product requires a and b to have the same number of components. If their dimensions differ, the operation is not defined.

What does a zero dot product mean? It means the two vectors are orthogonal (at a 90-degree angle to each other).

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators