Cross Product Calculator

Compute the cross product a x b of two 2D or 3D vectors. Get the result vector, its magnitude, the parallelogram and triangle areas, the angle between the vectors, and the unit normal, with a step-by-step determinant expansion.

https://hexacalculator.com/calculators/mathematics/algebra/cross-product-calculator

Mathematics

Algebra

Cross Product Calculator

Compute the cross product a x b of two 2D or 3D vectors. Get the result vector, its magnitude, the parallelogram and triangle areas, the angle between the vectors, and the unit normal, with a step-by-step determinant expansion.

Cross Product Calculator

Enter your two vectors

Pick whether your vectors live in space (3D) or in a plane (2D).

Enter the components of both vectors. The order matters: a × b and b × a point in opposite directions.

a × b = ( 14, 0, -7 )

x-component
y-component
z-component
Magnitude |a x b|
Triangle area
Angle between a and b
deg (°)
Length of a
Length of b
Dot product a . b

a × b = ( 14, 0, -7 ). Its magnitude 15.652476 is the parallelogram area, and the angle between a and b is 75.66483 deg (°).

Unit normal (direction of a × b): ( 0.894427, 0, -0.447214 ). Reverse the order and it flips to the opposite direction.

Step-by-step

Show the step-by-step

Expand the determinant one component at a time, with the numbers substituted in.

The determinant expanded one component at a time

Component

Formula

Substitute

Result

x-componentay*bz - az*by3 * 2 - 4 * -214
y-componentaz*bx - ax*bz4 * 1 - 2 * 20
z-componentax*by - ay*bx2 * -2 - 3 * 1-7
Loading calculator…

A cross product calculator takes two vectors and returns their vector product a x b. In three dimensions the answer is a new vector that points at a right angle to both of the originals, and its length equals the area of the parallelogram the two vectors span. Enter the components of each vector and this tool returns the result vector, its magnitude, the parallelogram and triangle areas, the angle between the vectors, and the unit direction.

What is the cross product?

The cross product is one of the two ways to multiply vectors. The dot product measures how much two vectors point the same way and returns a single number. The cross product does the opposite job: it measures how strongly two vectors differ in direction, and it returns a vector that stands perpendicular to the plane they share.

Because the result carries a direction, the cross product is the natural language for anything that twists or turns in space. Torque, angular momentum, and the force on a moving charge in a magnetic field are all cross products.

The cross product formula

For two vectors a = (ax, ay, az) and b = (bx, by, bz), each component of a x b is a small two by two difference:

a×b=(aybzazby,  azbxaxbz,  axbyaybx)\mathbf{a}\times\mathbf{b} = \left(a_y b_z - a_z b_y,\; a_z b_x - a_x b_z,\; a_x b_y - a_y b_x\right)

A tidy way to remember it is the determinant of a three by three matrix whose first row holds the unit vectors i, j, and k, whose second row is vector a, and whose third row is vector b. Expanding along the top row produces exactly the three components above.

a×b=ijkaxayazbxbybz\mathbf{a}\times\mathbf{b} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_x & a_y & a_z \\ b_x & b_y & b_z \end{vmatrix}

Magnitude, area, and the angle between vectors

The length of the cross product ties directly to the geometry of the two vectors:

a×b=absinθ|\mathbf{a}\times\mathbf{b}| = |\mathbf{a}|\,|\mathbf{b}|\,\sin\theta

That length is the area of the parallelogram built on a and b, so half of it is the area of the triangle they form. Because the sine term reaches its maximum at ninety degrees, the cross product is largest when the vectors are perpendicular and shrinks to zero when they line up. This calculator reports the angle from the dot product, which pins it down without the sign ambiguity that sine alone would leave.

The right-hand rule

The formula fixes the length of the result, and the right-hand rule fixes which way it points. Point the fingers of your right hand along the first vector, curl them toward the second, and your thumb points in the direction of a x b. Swap the order of the vectors and your thumb flips, which is why the cross product is anti-commutative:

b×a=(a×b)\mathbf{b}\times\mathbf{a} = -(\mathbf{a}\times\mathbf{b})

A worked example

Take a = (2, 3, 4) and b = (1, -2, 2). Work through the three components one at a time:

cx=aybzazby=324(2)=14c_x = a_y b_z - a_z b_y = 3\cdot 2 - 4\cdot(-2) = 14
cy=azbxaxbz=4122=0c_y = a_z b_x - a_x b_z = 4\cdot 1 - 2\cdot 2 = 0
cz=axbyaybx=2(2)31=7c_z = a_x b_y - a_y b_x = 2\cdot(-2) - 3\cdot 1 = -7

So a x b = (14, 0, -7). Its magnitude is the length of that vector:

a×b=142+02+(7)2=24515.65|\mathbf{a}\times\mathbf{b}| = \sqrt{14^2 + 0^2 + (-7)^2} = \sqrt{245} \approx 15.65

That length is the area of the parallelogram spanned by a and b. The triangle area is half of it, about 7.83, and the angle between the vectors works out to roughly 75.7 degrees.

Symbol

Meaning

Example

a, b

The two input vectors

(2, 3, 4) and (1, -2, 2)

a x b

Cross product (a vector)

(14, 0, -7)

|a x b|

Magnitude = parallelogram area

15.65

theta

Angle between a and b

75.7 degrees

Cross product of 2D vectors

The cross product is defined in three dimensions, but a flat 2D pair is handled by treating the missing third component as zero. With az and bz both zero, the x and y components of the result collapse to nothing and only the z-component survives:

axbyaybxa_x b_y - a_y b_x

That single signed number is what the 2D mode reports. Its sign tells you the turning sense, positive for counter-clockwise and negative for clockwise, and its absolute value is again the area of the parallelogram the two flat vectors span.

When the cross product is zero

If a x b comes out as the zero vector, the two vectors are parallel, one points exactly opposite the other, or one of them is the zero vector. In every one of those cases the parallelogram collapses to a line, its area is zero, and there is no single perpendicular direction to report. A zero cross product is therefore a quick test for whether two vectors are parallel.

Where the cross product shows up

Twist a wrench and the torque you produce is the cross product of the lever arm and the force. Send a charged particle through a magnetic field and the force it feels comes out perpendicular to both its motion and the field, again a cross product. In computer graphics the normal vector that tells a renderer which way a surface faces is the cross product of two edges of a triangle. Anywhere direction and rotation meet, this operation is close by.

Common mistakes to avoid

Keep the order straight, because a x b and b x a differ by a sign. Do not confuse the cross product with the dot product: the cross product returns a vector, the dot product returns a single number. Track the minus sign on the middle component carefully, since dropping it is the most common slip. And remember that the plain cross product lives in three dimensions, so a 2D problem is really the special case where the third component is zero.

This calculator is a learning and estimation aid. Check the setup of any physics or engineering problem, and mind the units your vectors carry, before relying on a result.

Frequently asked questions

How do you calculate the cross product of two vectors?

Put the two vectors below the unit vectors i, j, k as second and third row in a matrix and then develop the determinant. Each component is the difference of products. The x-component is the product of ay and bz minus the product of az and by, the y-component is the product of az and bx minus the product of ax and bz, and the z-component is the product of ax and by minus the product of ay and bx. This calculator performs all three calculations simultaneously and shows the substitutions being made.

What does the direction of a x b mean?

The cross product is perpendicular to the plane spanned by a and b, and its direction is determined by the right-hand rule. Point your right fingers in the direction of vector a and bend them towards vector b. Your thumb will point in the direction of the cross product. If you reverse the order, the sign changes so that b x a points in the opposite direction.

What is the geometric significance of magnitude?

The magnitude of the cross product corresponds to the area of the parallelogram spanned by two vectors. For this reason it is expressed as the product of the lengths of the two vectors and the sine of the angle between them. The area of the triangle formed from the same two vectors is exactly half of that area.

Why is this cross product zero?

A cross product of zero means that the two vectors are either parallel or in opposite directions, or one of them is a zero vector. In such cases, the two vectors do not generate any area and there is no unique perpendicular direction, so the result being zero is a simple way to check if two vectors are parallel.

How does the calculator handle 2D vectors?

Switch to the 2D mode and enter only the x- and y-components. The tool will consider the z-component as zero, cancel out the x- and y-parts of the result, and keep only the value resulting from the difference between the product of ax and by and the product of ay and bx. This value is the z-component of the full 3D cross-product, and its absolute value still corresponds to the area of the parallelogram.

Can you calculate the area of a triangle with the cross product?

Yes. You create two vectors from two sides of the triangle and calculate their cross product. The magnitude of this cross product is equal to the area of the parallelogram formed by these two sides. Half of this magnitude is the area of the triangle, and this tool outputs that value directly.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. MIT OpenCourseWare: The Cross Product (18.02 Multivariable Calculus)

    University treatment of the cross product, its determinant form, and its geometry.

  2. LibreTexts Mathematics: The Cross Product

    Open textbook derivation of the cross product, magnitude, area, and the right-hand rule.