Cross Product Calculator

The cross product takes two 3D vectors and returns a third vector at right angles to both. Enter two vectors and this expands the determinant step by step, checks that the result really is perpendicular to both inputs, and reads the magnitude as the area the two vectors span. If you wanted a single number measuring how aligned two vectors are, that is the dot product calculator instead.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Cross Product Calculator.

Cross or dot: which one you want

Two vector products get taught side by side and confused ever after, so here is the split in one sentence each. The cross product answers "what direction is perpendicular to both" and returns a whole vector; it only exists in 3D, and it is what this page computes. The dot product answers "how aligned are these two vectors" and returns one number, in any dimension. If alignment is what you came for, the dot product calculator is the page you want.

How the cross product works

Write the two vectors as the second and third rows of a 3 by 3 determinant, with the unit vectors i, j and k across the top, and expand along that top row. Each 2 by 2 cofactor produces one component of the answer, and the middle one picks up a minus sign, the same way every determinant expansion alternates.

What comes out is a vector with two jobs. Its direction is perpendicular to both inputs, chosen by the right hand rule. Its length is the area of the parallelogram the two inputs span, which is why the cross product shows up anywhere a "how much do these two directions disagree" quantity is needed: torque, angular momentum, surface normals in graphics, and the area of a triangle you only know by its corners.

The formula

a × b = (a2b3 − a3b2,  a3b1 − a1b3,  a1b2 − a2b1)
|a × b| = |a| × |b| × sin θ

Here a1, a2, a3 are the components of the first vector, b1, b2, b3 of the second, |a| and |b| are their lengths, and θ is the angle between them. The first line is how you compute it; the second is what the length of the result means.

Worked example

a = (2, 3, 4) and b = (5, 6, 7).

i component: (3)(7) − (4)(6) = 21 − 24 = −3
j component: (4)(5) − (2)(7) = 20 − 14 = 6
k component: (2)(6) − (3)(5) = 12 − 15 = −3

a × b = (-3, 6, -3)

|a × b| = √(9 + 36 + 9) = √54 = 7.348469, so the two vectors span a parallelogram of area 7.348469 and a triangle of area 3.674235.

Check: (-3)(2) + (6)(3) + (-3)(4) = -6 + 18 - 12 = 0, so the result is perpendicular to a, and the same check works against b.

The i, j, k cycle

The three coordinate directions cross into each other in a cycle worth memorizing, because every sign convention in 3D geometry traces back to it:

Read it as a wheel: going around in order (i to j to k and back to i) gives the next one with a plus sign. Reverse any pair and the answer negates: j × i = −k, k × j = −i, i × k = −j. And anything crossed with itself is the zero vector, because a vector spans no area with its own shadow.

The right hand rule

The determinant tells you the perpendicular line; the right hand rule tells you which of its two directions the answer takes. Point the fingers of your right hand along a, curl them toward b, and your thumb points along a × b. Curl the other way, from b toward a, and your thumb flips, which is the physical picture behind b × a = −(a × b). Order matters, and reversing it reverses the result.

Torque, the flagship use

Torque is the cross product with a job: τ = r × F, position crossed with force. Push on a wrench and the torque's magnitude is how hard the bolt is being turned, while its direction runs along the axis the bolt turns around, straight out of the plane of wrench and push. That is the cross product's whole trick in one tool: the sine factor means force along the wrench does nothing, force at right angles does the most, and the perpendicular direction names the axis of rotation. The torque calculator works that calculation with real wrenches and real bolts. Angular momentum is the same construction one derivative up: L = r × p, position crossed with momentum, which is why planets sweep out orbits in a fixed plane.

Why the cross product only lives in 3D

The cross product needs a direction perpendicular to two given ones, and 3D is the dimension where that request has exactly one line as its answer. In 2D there is no room: nothing in the plane is perpendicular to two non-parallel directions at once. In 4D there is too much room: a whole plane of perpendicular directions, with no fair way to pick one.

The 2D case does not die, though; it collapses to a single signed number, x1y2 − x2y1, which is the z component of the 3D answer once you lay both vectors flat at z = 0. That scalar is the signed area of the parallelogram, positive when b sits counterclockwise from a, and it is what game developers and geometry libraries mean when they say 2D cross product. Enter two 2-component vectors above and this page does exactly that, stating the z = 0 promotion in the steps. Honesty compels one footnote: a genuine cross product also exists in exactly 7 dimensions, a lovely curiosity tied to the octonions, but nothing in between and nothing you will meet in coursework.

Frequently asked questions

Why is the cross product a vector when the dot product is a number?

Because they answer different questions. The dot product measures how aligned two vectors are, and alignment is a single quantity. The cross product names the direction perpendicular to both inputs, and a direction needs a whole vector to state. Its length then carries a bonus answer: the area the two inputs span.

What does the magnitude of the cross product mean?

It is the area of the parallelogram with the two vectors as sides, equal to the product of the two lengths times the sine of the angle between them. Half of that is the area of the triangle with the two vectors as sides, which is what many people computing a cross product actually want.

What is the right hand rule?

The tiebreaker between the two possible perpendicular directions. Point the fingers of your right hand along the first vector, curl them toward the second, and your thumb points along the cross product. Swap the order of the vectors and your thumb flips, which is exactly the anticommutativity of the operation.

What does a zero cross product mean?

The two vectors are parallel or anti-parallel, or one of them is the zero vector. Parallel vectors span no area, and there is no single direction perpendicular to them: every direction at right angles to the shared line qualifies. The zero vector is the honest answer to a question with no unique answer.

Can you take the cross product of 2D vectors?

Lay them flat in 3D with z = 0 and yes, which is what this page does automatically. The result always points straight along z, and its one interesting component, x1 y2 minus x2 y1, is the signed area of the parallelogram: positive when the second vector sits counterclockwise from the first. That signed number is what 2D cross product usually means.

Does the order of the vectors matter?

Yes, and it is the sharpest difference from ordinary multiplication. Reversing the order negates every component: b cross a is exactly minus a cross b. The magnitude and the area are unchanged; only the direction of the result flips, from one side of the plane to the other.

Do I want the cross product or the dot product?

Ask what shape of answer you want. If you want a vector at right angles to two others, or the area they span, that is the cross product, and it lives in 3D. If you want one number saying how aligned two vectors are, that is the dot product, and it works in any dimension.

Related calculators