Cross Product Calculator (3D Vectors)

Enter two three-dimensional vectors and this calculator returns their cross product component by component, laid out as the 3×3 determinant expansion so you can follow each minor. It also gives the magnitude — which is the area of the parallelogram the two vectors span — the triangle area, the unit normal direction, and the angle between the vectors. Parallel inputs are reported honestly as a zero product with no defined normal, rather than as a division by zero.

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 xThe x-component of vector a. Any consistent unit works — the result carries the product of the two input units.1
a yThe y-component of vector a. Any consistent unit works — the result carries the product of the two input units.2
a zThe z-component of vector a. Any consistent unit works — the result carries the product of the two input units.3
b xThe x-component of vector b. Any consistent unit works — the result carries the product of the two input units.4
b yThe y-component of vector b. Any consistent unit works — the result carries the product of the two input units.5
b zThe z-component of vector b. Any consistent unit works — the result carries the product of the two input units.6

It returns

  • Magnitude |a × b| (parallelogram area) — Equals |a||b| sin θ, and equals the area of the parallelogram spanned by a and b.
  • x-component of a × b
  • y-component of a × b
  • z-component of a × b
  • Angle between a and b
  • Triangle area (half the magnitude)

The formula

a×b=(a2b3a3b2a3b1a1b3a1b2a2b1)
|a×b|=|a||b|sinθ

In plain text: a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁)

  • a, bThe two input vectors, each with three components (any)
  • a × bA vector perpendicular to both, oriented by the right-hand rule (product of the input units)
  • |a × b|The area of the parallelogram spanned by a and b (product of the input units)
  • θThe angle between a and b, from 0° to 180° (degrees)

The cross product exists only in three dimensions (and, in a different form, in seven). In two dimensions the analogue is the scalar a₁b₂ − a₂b₁.

Updated Category Vectors & Vector Operations Verified against published test cases Reading time 10 min

What the cross product produces

The cross product of two three-dimensional vectors is another vector, and it is defined by three properties working together. Its direction is perpendicular to both inputs. Its magnitude equals the area of the parallelogram the two vectors span. Its sense — which of the two perpendicular directions it picks — is fixed by the right-hand rule: point your right index finger along a, your middle finger along b, and your thumb points along a × b.

That combination is exactly what you need for torque, for angular momentum, for the magnetic force on a moving charge, and for the surface normal of a triangle in a 3D scene. In each case the physics or geometry cares about a direction perpendicular to a plane, and about a quantity proportional to how much of a plane two vectors actually span.

It differs from the dot product in every respect. The dot product returns a number and peaks when the vectors are aligned; the cross product returns a vector and peaks when they are perpendicular. The dot product is commutative; the cross product anticommutes, so b × a = −(a × b).

Why it is written as a determinant

Nobody memorises the component formula. What people memorise is the symbolic determinant with the basis vectors in the top row:

a × b = det [[i, j, k], [a₁, a₂, a₃], [b₁, b₂, b₃]]

Expand along the first row exactly as you would in the determinant calculator and the three components fall out. The i coefficient is the 2×2 minor from the last two columns, the j coefficient is the minor from columns 1 and 3 with a minus sign from the checkerboard, and the k coefficient is the minor from the first two columns. That minus sign on the middle term is why the second component is written a₃b₁ − a₁b₃ rather than the pattern you might expect.

The determinant form also explains the properties for free. Swapping two rows of a determinant flips its sign, which is why swapping a and b negates the answer. A determinant with two equal rows is zero, which is why a × a = 0. And it makes the scalar triple product c · (a × b) visibly the determinant of the three vectors stacked together — the signed volume of the parallelepiped they span.

The other identity worth carrying is |a × b| = |a||b| sin θ. Compare it with the dot product's |a||b| cos θ: since sin² + cos² = 1, the two together recover the full geometry of the pair, and the angle is best computed as atan2(|a × b|, a · b), which is what this calculator does because it stays accurate at both ends of the range.

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

Expand the symbolic determinant along its first row.

  1. x-component. Delete the i column, leaving [[2, 3], [5, 6]]. Its determinant is 2×6 − 3×5 = 12 − 15 = −3.
  2. y-component. Delete the j column, leaving [[1, 3], [4, 6]], whose determinant is 1×6 − 3×4 = 6 − 12 = −6. The cofactor sign is negative, so the component is +6. Equivalently, use the pre-signed form a₃b₁ − a₁b₃ = 3×4 − 1×6 = 6.
  3. z-component. Delete the k column, leaving [[1, 2], [4, 5]], whose determinant is 1×5 − 2×4 = 5 − 8 = −3.
  4. The product is (−3, 6, −3).
  5. Magnitude. √((−3)² + 6² + (−3)²) = √(9 + 36 + 9) = √54 = 7.348469. That is the area of the parallelogram, so the triangle with the same two edges has area 3.674235.
  6. Unit normal. Divide through: (−3, 6, −3)/7.348469 = (−0.408248, 0.816497, −0.408248).
  7. Angle. |a| = √14 = 3.741657 and |b| = √77 = 8.774964, so sin θ = 7.348469 / (3.741657 × 8.774964) = 7.348469 / 32.832910 = 0.223814, giving θ = 12.9332°.

Check the perpendicularity, which is the cheapest verification available: a · (a × b) = 1(−3) + 2(6) + 3(−3) = −3 + 12 − 9 = 0 ✓, and b · (a × b) = 4(−3) + 5(6) + 6(−3) = −12 + 30 − 18 = 0 ✓. Cross-check the angle with the dot product: a · b = 4 + 10 + 18 = 32, so cos θ = 32/32.832910 = 0.974632, and arccos of that is 12.9332° — the same answer from an independent route.

How to read the result

A zero cross product means the vectors are parallel. They lie along the same line, span no area, and have no unique perpendicular — every direction in the plane perpendicular to that line qualifies, so the calculator declines to name one. This is the standard test for collinearity of three points: form two edge vectors and cross them.

The magnitude is an area, so its units multiply. Cross a force in newtons with a position in metres and you get a torque in newton-metres. Cross two lengths in metres and you get an area in square metres. Reporting the number without the compound unit loses half the meaning.

The sign of each component encodes orientation. Reverse the operands and every component flips, and so does the normal direction. In graphics this is the difference between a surface facing the camera and one facing away, and it is why the winding order of triangle vertices matters.

The angle is always between 0° and 180°. The cross product's magnitude alone cannot distinguish 30° from 150°, because sin is positive on both — which is exactly why this calculator uses atan2 with the dot product supplying the sign of the cosine. If you only need the angle, the angle between vectors calculator does it directly.

Cross products of the basis vectors and other reference cases

The first three rows are the cyclic relations that define the right-handed convention: i → j → k → i. Reversing any of them flips the sign.
aba × b|a × b|Angle
i = (1,0,0)j = (0,1,0)k = (0,0,1)190°
j = (0,1,0)k = (0,0,1)i = (1,0,0)190°
k = (0,0,1)i = (1,0,0)j = (0,1,0)190°
j = (0,1,0)i = (1,0,0)−k = (0,0,−1)190°
(1,2,3)(4,5,6)(−3, 6, −3)7.34846912.9332°
(4,5,6)(1,2,3)(3, −6, 3)7.34846912.9332°
(1,2,3)(2,4,6)(0, 0, 0)0
(3,0,0)(0,2,0)(0, 0, 6)690°

The last row is the geometric statement in its simplest form: two perpendicular vectors of length 3 and 2 span a rectangle of area 6.

Mistakes and limitations

  • Dropping the minus sign on the middle component. The cofactor expansion alternates, so the j term is subtracted. Writing a₁b₃ − a₃b₁ instead of a₃b₁ − a₁b₃ flips the whole vector's y-component and silently reverses the normal.
  • Assuming the cross product is associative. It is not: (a × b) × c is generally different from a × (b × c). The correct expansion is the BAC-CAB rule, a × (b × c) = b(a·c) − c(a·b).
  • Trying to cross two-dimensional vectors. The cross product needs three dimensions. For 2D vectors, treat them as 3D with a zero z-component: the result points purely along z, and its single component a₁b₂ − a₂b₁ is the signed area often called the 2D cross product.
  • Cancelling in a cross-product equation. a × b = a × c does not imply b = c; the two may differ by any multiple of a.
  • Confusing it with the dot product. The dot product is a number that is largest when the vectors align; the cross product is a vector that is largest when they are perpendicular. They answer opposite questions.
  • Assuming a left-handed convention. Some graphics APIs use left-handed coordinates, in which the visual sense of the result reverses even though the arithmetic does not. Check your coordinate system before trusting a normal direction.

Two uses that pay for learning it

Torque. τ = r × F, where r runs from the pivot to the point of application. The sin θ factor is why pushing straight at a hinge does nothing and pushing perpendicular to the door does the most — and why a longer wrench is a bigger torque for the same force.

Surface normals. For a triangle with vertices P, Q, R, form the edge vectors u = Q − P and v = R − P; then u × v is normal to the triangle and half its magnitude is the triangle's area. Every lighting calculation in 3D graphics starts here, which is also why a degenerate triangle with collinear vertices produces a zero normal and renders black.

For the companion operation, the dot product calculator handles vectors of any dimension and tests for orthogonality. When the angle is what you actually want, the angle between vectors calculator gives it directly, and the vector projection calculator splits one vector into a component along another plus a perpendicular remainder — the perpendicular part is precisely what the cross product measures the size of.

Because the cross product is a determinant in disguise, the determinant calculator is the natural place to compute a scalar triple product: put your three vectors in as rows and the determinant is the signed volume of the parallelepiped, zero exactly when the three are coplanar. In vector calculus, the curl of a field is the cross product of the gradient operator with the field, so the curl calculator is the same operation applied to derivatives rather than numbers.

Frequently asked questions

What does a zero cross product tell me?

That the two vectors are parallel or antiparallel — they lie along the same line and span no area. It is the standard collinearity test: given three points, form two edge vectors and cross them; a zero result means the points are on one line. A zero also occurs trivially if either input is the zero vector, which the calculator flags separately because no angle is defined in that case.

Why is the cross product only defined in three dimensions?

Because ‘perpendicular to both’ picks out a unique direction only in 3D. In two dimensions there is no third direction to point in; in four, the space perpendicular to two vectors is itself two-dimensional, so no single vector is singled out. The general-dimension replacement is the wedge product, which returns an oriented plane element rather than a vector. A genuine seven-dimensional cross product also exists, but it is a curiosity rather than a tool.

How do I get the unit normal to a plane through three points?

Subtract to get two edge vectors — u = Q − P and v = R − P — then compute u × v and divide by its magnitude. This calculator shows those three unit-normal components in the working whenever the product is non-zero. If the three points are collinear the product is zero and there is no plane through them to be normal to.

Is a × b the same as b × a?

No; they are exact negatives. Swapping the operands swaps two rows of the defining determinant, which flips its sign, so every component reverses. The magnitude is unchanged, so the area interpretation is the same, but the normal points the opposite way. In practice this decides which side of a surface is considered the front.

How do I compute a cross product of 2D vectors?

Set the z-components to zero. The x and y components of the result then vanish and only the z component survives, equal to a₁b₂ − a₂b₁. That single signed number is what people mean by the 2D cross product: its magnitude is the parallelogram area, and its sign tells you whether b is counter-clockwise from a. It is the standard orientation test in computational geometry.

What units does the result have?

The product of the two input units. Metres crossed with newtons gives newton-metres of torque; metres crossed with metres gives square metres of area. The calculator works in whatever consistent units you type, so keep both vectors in the same system and attach the compound unit to the answer yourself.

Why does the calculator use atan2 for the angle?

Because computing the angle from the sine alone cannot distinguish 30° from 150°, and computing it from the cosine alone loses accuracy for angles near 0° and 180°. Feeding the cross-product magnitude and the dot product into atan2 uses both, giving a stable answer across the whole range from 0° to 180°.

What is the largest a cross product can be?

|a||b|, reached exactly when the vectors are perpendicular, because sin θ then equals 1. For the basis vectors i and j, both of length 1 and at 90°, the product has magnitude 1. As the vectors move toward parallel the magnitude shrinks continuously to zero, and the calculator reports the maximum value |a||b| in its note whenever the two happen to be perpendicular.

References