Vector Cross Product Calculator

Enter the three components of each vector and this calculator returns a × b, its magnitude, the unit normal it defines, the angle between the two vectors, and the areas of the parallelogram and triangle they span. The cross product is the standard way to get a direction perpendicular to two others — a surface normal in graphics, a torque axis in mechanics, an angular-momentum direction in physics — and its length is exactly the area those two vectors enclose. Every component is shown as its own determinant so you can follow the arithmetic.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
a: x componentThe x component of the first vector.1
a: y componentThe y component of the first vector.2
a: z componentThe z component of the first vector. Enter 0 for a vector that lies in the xy plane.3
b: x componentThe x component of the second vector.4
b: y componentThe y component of the second vector.5
b: z componentThe z component of the second vector. Order matters: b × a is the negative of a × b.6

It returns

  • (a × b) — x component — The i component, a_y·b_z − a_z·b_y. Read it with the two components below as one vector.
  • (a × b) — y component
  • (a × b) — z component
  • |a × b| — parallelogram area — The length of the cross product, which equals the area of the parallelogram spanned by a and b.
  • Triangle area — Half the parallelogram area — the area of the triangle with a and b as two of its sides.
  • Angle between a and b — Taken from the dot product, so it is the unsigned angle in [0°, 180°].

The formula

a×b=(aybzazbyazbxaxbzaxbyaybx)
|a×b|=|a||b|sinθ
Area=12|a×b|

In plain text: a × b = (a_y b_z − a_z b_y, a_z b_x − a_x b_z, a_x b_y − a_y b_x); |a × b| = |a||b| sin θ

  • a, bThe two input vectors, each with x, y and z components (any)
  • a × bThe cross product — a vector perpendicular to both (product of a and b units)
  • |a × b|Its magnitude, equal to the parallelogram area a and b span (product of a and b units)
  • θThe unsigned angle between a and b, in [0°, 180°] (degrees)
  • Unit normal — a × b divided by |a × b| (dimensionless)

Each component is a 2×2 determinant of the other two axes, which is why the middle component appears with a minus sign in the standard determinant layout. The cross product exists only in three dimensions (and, exceptionally, seven); in two dimensions the usual substitute is the scalar a_x b_y − a_y b_x.

Updated Category Matrices, Vectors & Complex Numbers Verified against published test cases Reading time 12 min

What the cross product gives you

The cross product of two 3D vectors is a third vector perpendicular to both, whose length equals the area of the parallelogram the first two span. That single sentence contains the two reasons it is used: you need a direction perpendicular to a pair of vectors, or you need the area they enclose. Both come from the same computation, which is why this page reports them together.

It differs from the dot product in kind, not just in formula. The dot product returns a scalar and measures how much two vectors point the same way — it peaks when they are parallel and vanishes when they are perpendicular. The cross product returns a vector and measures how much they point in different ways — it vanishes when they are parallel and peaks when they are perpendicular. Between them they decompose the relationship between two vectors completely, which is the content of the identity |a × b|² + (a·b)² = |a|²|b|².

The cross product is a three-dimensional object in an unusually strict sense: no analogue with all the same properties exists in two, four, five or six dimensions. In two dimensions people use the scalar axbyaybx, which is the z component of the 3D cross product of the same vectors with zero z components — you can get it from this calculator by leaving both z fields at 0.

The determinant form and where the minus sign comes from

The usual way to write the cross product is as a symbolic determinant with the basis vectors in the top row and the two vectors' components underneath. Expanding along that row gives three 2×2 determinants, one per axis, and each of those uses the other two components. The i component uses the y and z rows, the j component uses the x and z rows, and the k component uses the x and y rows.

Cofactor expansion attaches alternating signs +, −, + along the top row, so the j term is subtracted. Written out with that sign absorbed, the components are aybzazby, then azbxaxbz, then axbyaybx. Once you see them in that order the pattern is cyclic: x → y → z → x with no exceptions, which is far easier to remember than three separate rules. The determinant calculator handles the same expansion for numeric matrices.

Why the length is an area. The parallelogram with sides a and b has base |a| and perpendicular height |b| sin θ, so its area is |a||b| sin θ. Squaring the component formula and simplifying gives exactly |a|²|b|² − (a·b)², and substituting a·b = |a||b| cos θ turns that into |a|²|b|²(1 − cos² θ). Take the square root and the area falls out.

Direction and the right-hand rule. The formula gives a perpendicular direction, but a line has two perpendicular senses and the algebra picks one. Point the fingers of your right hand along a, curl them towards b, and your thumb points along a × b. This is a convention fixed by the choice of a right-handed coordinate system, and it is why b × a = −(a × b).

Worked example: (1, 2, 3) × (4, 5, 6)

These are the calculator's defaults, so you can follow along on the page.

  1. i component. aybzazby = (2)(6) − (3)(5) = 12 − 15 = −3.
  2. j component. azbxaxbz = (3)(4) − (1)(6) = 12 − 6 = 6.
  3. k component. axbyaybx = (1)(5) − (2)(4) = 5 − 8 = −3.
  4. Magnitude. √((−3)² + 6² + (−3)²) = √(9 + 36 + 9) = √54 = 7.3484692. That is the parallelogram area.
  5. Triangle area. 7.3484692 ÷ 2 = 3.6742346.
  6. Unit normal. (−3, 6, −3) ÷ 7.3484692 = (−0.4082483, 0.8164966, −0.4082483). Those are −1/√6, 2/√6 and −1/√6.
  7. Angle. |a| = √14 = 3.7416574 and |b| = √77 = 8.7749644, so |a||b| = √1078 = 32.8329104. Then sin θ = 7.3484692 ÷ 32.8329104 = 0.2238143, giving θ = 12.933°.

The check that catches sign errors. The cross product must be perpendicular to both inputs, so both dot products must be zero. (−3)(1) + (6)(2) + (−3)(3) = −3 + 12 − 9 = 0, and (−3)(4) + (6)(5) + (−3)(6) = −12 + 30 − 18 = 0. Do this on every hand calculation; a flipped sign in one component almost always breaks it.

Cross-check the angle a second way with the dot product: a·b = 4 + 10 + 18 = 32, so cos θ = 32 ÷ 32.8329104 = 0.9746320 and θ = 12.933°. The two routes agree, and squaring both gives 0.0500928 + 0.9499072 = 1 as they must.

How to read the magnitude, the angle and the normal

A magnitude of zero means the vectors are collinear. The cross product vanishes exactly when the two vectors lie along the same line, in either direction. In geometry that means three points are collinear; in graphics it means a triangle is degenerate and has no surface normal, which is the usual cause of a black facet in a render. This calculator raises a note and omits the unit-normal column when that happens, because dividing by zero has no answer.

The magnitude peaks at 90°. Since |a × b| = |a||b| sin θ and sin θ is largest at θ = 90°, perpendicular vectors span the largest possible area for their lengths. Note the symmetry that follows: 30° and 150° give identical magnitudes, because sin 30° = sin 150° = 0.5. The magnitude alone therefore cannot tell an acute arrangement from an obtuse one — only the dot product's sign can. That is why this page computes the angle from the dot product rather than from the cross product.

The unit normal is a direction, not a size. Its three components always satisfy ux² + uy² + uz² = 1. It is the vector you need for a plane equation: if a plane contains a point p and the directions a and b, then its equation is ·(xp) = 0. Flip the input order and the normal flips too, which in graphics decides which side of a polygon is treated as the front face.

Units multiply. If a is a position in metres and b is a force in newtons, then a × b is a torque in newton-metres. The calculator is unitless because the components can carry whatever units you bring; just remember the product's units are the product of the inputs', not either one alone.

How the spanned area varies with the angle between the vectors

Every row uses |a| = 5 and |b| = 3, so |a||b| = 15. The cross-product magnitude is 15 sin θ and the dot product is 15 cos θ.
Angle θsin θ|a × b|Triangle areaa · b
0.0000000.0000000.00000015.000000
15°0.2588193.8822861.94114314.488887
30°0.5000007.5000003.75000012.990381
45°0.70710710.6066025.30330110.606602
60°0.86602512.9903816.4951917.500000
75°0.96592614.4888877.2444443.882286
90°1.00000015.0000007.5000000.000000
120°0.86602512.9903816.495191−7.500000
150°0.5000007.5000003.750000−12.990381
180°0.0000000.0000000.000000−15.000000

Read the 30° and 150° rows together: identical cross-product magnitudes, opposite dot-product signs. At 45° the two columns coincide at 10.606602, because sin θ = cos θ there — that is the only angle in [0°, 180°] where the cross-product magnitude and the dot product are equal.

The basis vectors multiply cyclically

Everything about cross-product signs follows from nine products. Reading a row as the first factor and a column as the second:

a × b for the standard right-handed basis. The diagonal is zero because a vector is parallel to itself.
×ijk
i0k−j
j−k0i
kj−i0

The cyclic order i → j → k → i gives a plus sign; going against it gives a minus. Because the table is antisymmetric about its diagonal, the whole operation is antisymmetric: swapping the operands negates the result.

Mistakes, conventions and limits

  • Getting the order backwards. The cross product is anticommutative, so a × b and b × a differ by a sign in every component. In torque, r × F and F × r point opposite ways, and only the first is the torque.
  • Forgetting the minus on the j component. Working from the determinant layout, the middle cofactor carries a negative sign. Writing axbz − azbx instead of azbx − axbz is the single most frequent slip.
  • Assuming it is associative. It is not: (a × b) × c and a × (b × c) are generally different vectors. The bracket is never optional, and the triple product identity a × (b × c) = b(a·c) − c(a·b) is how you expand one.
  • Reading the magnitude as an angle indicator. Because sin θ is symmetric about 90°, a magnitude cannot distinguish 40° from 140°. Use the dot product's sign, which this page reports through the angle output.
  • Normalising a zero vector. If a and b are parallel the cross product is zero and there is no unit normal. Code that divides without checking produces NaN components and, downstream, invisible geometry.
  • Expecting a cross product in 2D or 4D. A vector product with these properties exists only in three and seven dimensions. In the plane, use the scalar axby − aybx, whose sign tells you the turn direction.

Where the cross product does real work

Mechanics. Torque is τ = r × F, with r running from the pivot to the point of application. The magnitude |r||F| sin θ explains why a force applied along the lever arm does nothing and one applied perpendicular does the most. Angular momentum L = r × p and the magnetic force F = qv × B have the same shape.

Geometry and graphics. The normal of a triangle with vertices P, Q and R is (Q − P) × (R − P), and half its length is the triangle's area — the fastest way to get the area of a triangle in space without finding any angles. The scalar triple product a·(b × c) gives the volume of the parallelepiped on those three edges, and it is zero exactly when the three are coplanar, which is also the determinant of the matrix holding them as rows.

When to use something else. If you want how much two vectors agree in direction, or a projection, use the dot product. If you want to compose rotations rather than find a single axis, use rotation matrices — the matrix multiplication calculator handles those — or quaternions, which extend the plane rotations that complex numbers describe into three dimensions without the sign traps. And if you need the principal axes of a symmetric tensor rather than a normal to two given directions, that is an eigenvalue problem.

Key terms

Cross product
The vector a × b perpendicular to both a and b, with magnitude |a||b| sin θ and direction fixed by the right-hand rule. Also called the vector product.
Unit normal
The cross product divided by its own magnitude, giving a vector of length 1 perpendicular to the plane of a and b.
Anticommutative
A product for which swapping the operands negates the result: b × a = −(a × b). Contrast the dot product, which is commutative.
Right-hand rule
The convention fixing which of the two perpendicular directions the cross product takes: fingers along a, curling to b, thumb along a × b.
Scalar triple product
a·(b × c), equal to the signed volume of the parallelepiped with those three edges and to the determinant of the matrix formed from them.
Degenerate triangle
A triangle whose three vertices are collinear. Its cross product is the zero vector, so it has zero area and no normal.

Frequently asked questions

What does the cross product actually tell you?

Two things at once: a direction perpendicular to both input vectors, and, in its length, the area of the parallelogram they span. So (1,2,3) × (4,5,6) = (−3, 6, −3) points perpendicular to both, and its length √54 = 7.3485 is the area those two vectors enclose. Halve that for the triangle. If you only want the area, the length is all you need; if you want a surface normal, divide by that length to get a unit vector.

Why is a × b not the same as b × a?

Because the cross product is anticommutative: swapping the operands negates every component. (1,2,3) × (4,5,6) = (−3, 6, −3), while (4,5,6) × (1,2,3) = (3, −6, 3). Geometrically the two results point out of opposite faces of the same parallelogram, and the right-hand rule picks which. The magnitude, and therefore the area, is identical either way.

How do I find a normal vector to a plane through three points?

Subtract to get two edge vectors, then cross them. For points P, Q and R, compute a = Q − P and b = R − P, enter those here, and the unit-normal column is the plane's normal. The plane equation is then n̂·(x − P) = 0. If the cross product comes out as the zero vector, the three points are collinear and they do not determine a plane at all.

What happens when the two vectors are parallel?

The cross product is the zero vector, because sin 0° = 0 and sin 180° = 0. Parallel vectors lie along one line, span no area, and have no unique perpendicular — every direction in the perpendicular plane is equally valid. This calculator returns zeros for all three components and omits the unit-normal column rather than printing a row of dashes.

Can I use this for 2D vectors?

Yes, by leaving both z fields at zero. The result then has zero x and y components, and its z component is axby − aybx — the quantity usually called the 2D cross product. Its absolute value is the parallelogram area, and its sign tells you the turn direction: positive means b is anticlockwise from a, negative means clockwise. That sign test is the core of convex-hull and polygon-orientation algorithms.

How is the cross product related to the dot product?

They are complementary halves of the same relationship. The dot product is |a||b| cos θ and the cross-product magnitude is |a||b| sin θ, so squaring and adding gives |a × b|² + (a·b)² = |a|²|b|², an identity known as Lagrange's. That means one is largest exactly where the other vanishes. Use the dot product for the angle, because it distinguishes acute from obtuse; the cross product alone cannot.

Is the cross product associative?

No, and the brackets are never optional. (i × i) × j is the zero vector, while i × (i × j) = i × k = −j. To expand a nested product use the triple product identity a × (b × c) = b(a·c) − c(a·b), sometimes remembered as “BAC minus CAB”. Distributivity over addition does hold, and so does compatibility with scalar multiplication.

What is a typical use in physics?

Torque is the most common: τ = r × F, where r runs from the pivot to where the force acts. A 0.4 m spanner with 50 N applied at right angles gives |τ| = 0.4 × 50 × sin 90° = 20 N·m, and the direction along the cross product is the axis the nut turns about. Apply the same force along the spanner instead and sin 0° = 0 gives no torque at all, which matches intuition exactly.

References

  • Introduction to Linear Algebra, 5th ed. — Gilbert Strang, Wellesley-Cambridge Press
  • Div, Grad, Curl, and All That: An Informal Text on Vector Calculus, 4th ed. — H. M. Schey, W. W. Norton
  • NIST Digital Library of Mathematical Functions, §4.14 Trigonometric IdentitiesNational Institute of Standards and Technology
  • Classical Mechanics, 3rd ed. (Chapter 1, vector algebra and torque) — Herbert Goldstein, Charles Poole and John Safko, Addison-Wesley