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 axby − aybx, 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 aybz − azby, then azbx − axbz, then axby − aybx. 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.
- i component. aybz − azby = (2)(6) − (3)(5) = 12 − 15 = −3.
- j component. azbx − axbz = (3)(4) − (1)(6) = 12 − 6 = 6.
- k component. axby − aybx = (1)(5) − (2)(4) = 5 − 8 = −3.
- Magnitude. √((−3)² + 6² + (−3)²) = √(9 + 36 + 9) = √54 = 7.3484692. That is the parallelogram area.
- Triangle area. 7.3484692 ÷ 2 = 3.6742346.
- Unit normal. (−3, 6, −3) ÷ 7.3484692 = (−0.4082483, 0.8164966, −0.4082483). Those are −1/√6, 2/√6 and −1/√6.
- 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 n̂·(x − p) = 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
| Angle θ | sin θ | |a × b| | Triangle area | a · b |
|---|---|---|---|---|
| 0° | 0.000000 | 0.000000 | 0.000000 | 15.000000 |
| 15° | 0.258819 | 3.882286 | 1.941143 | 14.488887 |
| 30° | 0.500000 | 7.500000 | 3.750000 | 12.990381 |
| 45° | 0.707107 | 10.606602 | 5.303301 | 10.606602 |
| 60° | 0.866025 | 12.990381 | 6.495191 | 7.500000 |
| 75° | 0.965926 | 14.488887 | 7.244444 | 3.882286 |
| 90° | 1.000000 | 15.000000 | 7.500000 | 0.000000 |
| 120° | 0.866025 | 12.990381 | 6.495191 | −7.500000 |
| 150° | 0.500000 | 7.500000 | 3.750000 | −12.990381 |
| 180° | 0.000000 | 0.000000 | 0.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:
| × | i | j | k |
|---|---|---|---|
| i | 0 | k | −j |
| j | −k | 0 | i |
| k | j | −i | 0 |
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.
