Uni-Sine
MathematicsVectors and matrices

Cross product calculator for 3D vectors

The cross product of two 3D vectors a and b is a new vector, a × b, at right angles to both of them. Its components are (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁), and its length is |a||b| sin θ, the area of the parallelogram the two vectors make. Our cross product calculator is part of the Vectors Calculator: switch it to 3D, type both vectors, and it gives a × b alongside the dot product, both lengths and the angle between them.

Try it

Vectors Calculator

Visualise magnitude, direction and operations

Go to its page

How to find a cross product in the calculator

  1. Open the Vectors Calculator. It starts in Single mode, so choose 3D at the top of the sidebar. The cross product only appears in 3D.
  2. Under Vectors, type the x, y and z components of vector a and vector b.
  3. Read a × b in the Results section, to 2 decimal places, with |a|, |b|, the angle θ between them and the dot product a · b.
  4. Open Formulas to see the component formula with the answer beside it.
  5. Drag an empty part of the 3D view to turn it, or drag a vector's tip to move it. Reset vectors puts them back to the start.

The calculator gives the answer and the formula, not a line-by-line working, and it draws a and b but not a × b itself. The method below shows how to work it out and check it by hand.

The cross product formula

\vec{a} \times \vec{b} = (a_2b_3 - a_3b_2,\ a_3b_1 - a_1b_3,\ a_1b_2 - a_2b_1)For a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃)

There is a pattern to each component: it uses the other two coordinates, never its own. The x component is built from the y and z parts, the y component from z and x, and the z component from x and y, always going round in that cycle.

The determinant method

Many courses remember the formula as a 3 by 3 determinant, with the unit vectors i, j and k in the top row:

ijk
a₁a₂a₃
b₁b₂b₃

Expand along the top row with the signs plus, minus, plus. Covering i's row and column leaves a₂b₃ − a₃b₂. Covering j's leaves a₁b₃ − a₃b₁, which the minus sign turns into a₃b₁ − a₁b₃. Covering k's leaves a₁b₂ − a₂b₁. That gives the same three components.

Worked examples you can check in the calculator

Example 1: the calculator's starting vectors

In 3D mode the calculator starts with a = (3, 4, 2) and b = (−1, 2, 5).

ComponentWorkingValue
x4 × 5 − 2 × 216
y2 × (−1) − 3 × 5−17
z3 × 2 − 4 × (−1)10

So a × b = (16, −17, 10). Check that it is at right angles to both: its dot product with a is 48 − 68 + 20 = 0, and with b it is −16 − 34 + 50 = 0. Both zero, so it is perpendicular to each.

Example 2: order matters

Take i = (1, 0, 0) and j = (0, 1, 0). Then i × j = (0, 0, 1) = k, but j × i = (0, 0, −1) = −k. Swapping the order flips the direction: b × a = −(a × b). Try it in the calculator with i as vector a and j as vector b, then swap them over, and watch the sign change.

Example 3: area of a parallelogram and a triangle

The length of a × b is the area of the parallelogram with sides a and b. For a = (3, −2, 1) and b = (2, 1, 4):

\vec{a} \times \vec{b} = ((-2) \times 4 - 1 \times 1,\ 1 \times 2 - 3 \times 4,\ 3 \times 1 - (-2) \times 2) = (-9,\ -10,\ 7)
|\vec{a} \times \vec{b}| = \sqrt{81 + 100 + 49} = \sqrt{230} = 15.17

The parallelogram's area is 15.17 square units, and the triangle with sides a and b has half that, 7.58.

Example 4: a normal vector to a plane

Find the plane through P(1, 0, 0), Q(0, 2, 0) and R(0, 0, 3). Two vectors in the plane are PQ = (−1, 2, 0) and PR = (−1, 0, 3). Their cross product is at right angles to the plane:

\vec{PQ} \times \vec{PR} = (2 \times 3 - 0 \times 0,\ 0 \times (-1) - (-1) \times 3,\ (-1) \times 0 - 2 \times (-1)) = (6,\ 3,\ 2)

So the plane is 6x + 3y + 2z = d, and putting in P gives d = 6: 6x + 3y + 2z = 6. Q and R fit too, since 3 × 2 = 6 and 2 × 3 = 6.

Example 5: torque in physics

Torque is τ = r × F. A spanner 0.3 m long along the x axis, pushed with 20 N along the y axis, gives τ = (0.3, 0, 0) × (0, 20, 0) = (0, 0, 6) N m: 6 N m about the z axis.

Try one

practice
Pick an answer, then check it.
What is (1, 0, 0) × (0, 0, 1)?

The right-hand rule and the magnitude

The formula gives the direction automatically, but you can picture it. Point the fingers of your right hand along a and curl them towards b: your thumb points along a × b. The length is:

|\vec{a} \times \vec{b}| = |\vec{a}|\ |\vec{b}| \sin\theta

For example 1, |a| = 5.385, |b| = 5.477 and θ = 59.43°, so |a × b| = 25.40, the same as √(16² + 17² + 10²). The calculator shows |a|, |b| and θ, so you can check this. Parallel vectors have θ = 0 and a cross product of zero: (2, 4, 6) × (1, 2, 3) = (0, 0, 0).

Cross product vs dot product

Dot product a · bCross product a × b
AnswerA numberA vector
Size|a||b| cos θ|a||b| sin θ
Zero whenThe vectors are perpendicularThe vectors are parallel
Ordera · b = b · aa × b = −(b × a)
DimensionsAny3D only

Common mistakes

  • Forgetting the minus sign on the middle term in the determinant method. The second component is a₃b₁ − a₁b₃, not a₁b₃ − a₃b₁.
  • Swapping the order. b × a points the opposite way to a × b.
  • Multiplying matching components. That is part of the dot product. Each cross product component uses the other two coordinates.
  • Expecting a number. The cross product is a vector. Its length is a number.
  • Using a 2D calculator mode. The cross product is defined for 3D vectors. For 2D vectors, write them with z = 0 and choose 3D.

Common questions

How do you calculate a cross product?
For a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). For (3, 4, 2) × (−1, 2, 5) that is (16, −17, 10).
Can you take the cross product of 2D vectors?
Not as a 2D vector. Add z = 0 to both and the cross product points straight out of the plane: (a₁, a₂, 0) × (b₁, b₂, 0) = (0, 0, a₁b₂ − a₂b₁). The number a₁b₂ − a₂b₁ is sometimes called the 2D cross product, and it gives the signed area of the parallelogram.
What does the cross product tell you?
Its direction is perpendicular to both vectors, which gives a normal to a plane. Its length is the area of the parallelogram they make. In physics it gives torque, angular momentum and the force on a moving charge in a magnetic field.
How do you check a cross product answer?
Take its dot product with each of the original vectors. Both should be zero, because the cross product is perpendicular to both.
Is the cross product commutative?
No. a × b = −(b × a): swapping the order keeps the length but reverses the direction.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Vectors Calculator

    Visualise magnitude, direction and operations

    Open the tool
  • Test it

    College Calculus II & III

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
  • Test it

    College Linear Algebra

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · Vectors and matricesDot product calculator: 2D and 3D, with the angleFree dot product calculator: find the dot product of two vectors in 2D or 3D, and the angle between them, with the formula worked through.