Cross Product Calculator a × b
Enter two 3D vectors (three numbers each, separated by spaces or commas). The calculator returns the cross product vector, which is perpendicular to both inputs, along with its magnitude.
This free cross product calculator takes two 3D vectors and returns a third vector that is perpendicular to both of them, along with its magnitude, instantly and with the full working shown. Type vector a and vector b above, press Calculate, and you get a×b as an ordered triple plus the length of that result — no sign-up, works on mobile.
What is the cross product?
The cross product of two vectors, written a×b, is a third vector that points in a direction perpendicular to both a and b. This is what makes it so useful: given any two directions in space, the cross product hands you a direction at right angles to the plane they span. Where the dot product of two vectors gives a single number (a scalar), the cross product gives a whole vector — it has both a direction and a length.
A crucial fact sets the cross product apart from almost every other vector operation: it is defined only in three dimensions. You cannot take the cross product of two 2D vectors or two 4D vectors and get another vector of the same kind — the neat “perpendicular to both” property is a special gift of 3D space. That is why the calculator above insists on exactly three numbers per vector and refuses anything else.
Formally, for a = (ax, ay, az) and b = (bx, by, bz), the cross product is the vector whose components are built by cycling through the coordinates: each component of the result mixes the other two coordinates of the two inputs. Written out, a×b = (aybz − azby, azbx − axbz, axby − aybx).
The formula in one line
a × b = ( aybz − azby , azbx − axbz , axby − aybx ). Each component is a small 2×2 determinant built from the coordinates you leave out.
How to use the cross product calculator
The tool is built to be fast and forgiving. You enter two vectors and read off the answer:
- Type Vector a as three numbers, separated by spaces or commas — for example
1 0 0or2, -3, 4. - Type Vector b the same way, again with exactly three numbers.
- Press Calculate a × b. The perpendicular result vector appears in the highlighted box as an ordered triple
( x , y , z ). - Read the magnitude below it — the length of the cross product, which equals the area of the parallelogram formed by a and b.
- Open Show the working to see each of the three components computed from the formula.
If either box does not contain exactly three valid numbers, the calculator stops and tells you why — for example that a vector has too few entries, or that a value could not be read as a number — so you can correct the input instead of guessing.
Step-by-step worked example
Let a = (2, 3, 4) and b = (5, 6, 7). We compute each component of a×b in turn.
The x-component uses the y and z coordinates: aybz − azby = (3)(7) − (4)(6) = 21 − 24 = −3.
The y-component uses the z and x coordinates (note the reversed order): azbx − axbz = (4)(5) − (2)(7) = 20 − 14 = 6.
The z-component uses the x and y coordinates: axby − aybx = (2)(6) − (3)(5) = 12 − 15 = −3.
So a×b = (−3, 6, −3). You can sanity-check that this result is perpendicular to both inputs by taking dot products: a · (a×b) = (2)(−3) + (3)(6) + (4)(−3) = −6 + 18 − 12 = 0, and likewise b · (a×b) = 0. A zero dot product confirms the right angle. The magnitude is the square root of (−3)² + 6² + (−3)² = the square root of 54, which is about 7.35.
The geometric meaning: area, angle, and the right-hand rule
The cross product is not just an algebra trick — it carries real geometry. Its magnitude equals the area of the parallelogram whose two sides are a and b. In symbols, |a×b| = |a| |b| sin(theta), where theta is the angle between the two vectors. When a and b point in nearly the same direction, sin(theta) is small and the parallelogram is thin, so the cross product is short. When they are perpendicular, sin(theta) = 1 and the area — and the cross product’s length — is largest.
This immediately explains an important special case: if a and b are parallel (or one of them is the zero vector), the angle between them is 0 or 180 degrees, sin(theta) = 0, and the cross product is the zero vector. There is no unique perpendicular plane, so the operation returns nothing but zeros.
The direction of a×b is fixed by the right-hand rule. Point the fingers of your right hand along a, curl them toward b, and your thumb points along a×b. This is why the order matters and why the operation is not symmetric — swapping the two vectors flips your thumb to the opposite side.
Cross product in Python with NumPy
For anything beyond a quick hand calculation, Python’s NumPy library computes the cross product in a single call with numpy.cross:
import numpy as np
a = np.array([2, 3, 4])
b = np.array([5, 6, 7])
c = np.cross(a, b)
print(c) # [-3 6 -3]
print(np.linalg.norm(c)) # 7.3484... (the magnitude)
The result matches the calculator exactly. Use np.linalg.norm to get the magnitude, and remember that np.cross(a, b) is not the same as np.cross(b, a) — the second returns the negated vector. NumPy also supports stacks of vectors, so you can cross whole arrays of them at once, which is common in graphics and physics code.
First, the cross product is defined only in 3D — two-number or four-number vectors have no ordinary cross product, so this tool requires exactly three components. Second, the cross product is anti-commutative: a × b = −(b × a). Swapping the inputs reverses the result vector, so order is never optional. Third, do not confuse it with the dot product, which returns a single number, not a vector. Fourth, watch the middle component — its formula uses azbx − axbz, the reversed order that trips up many students. Finally, if you get the zero vector, your inputs are parallel; that is a correct answer, not a bug.
Where the cross product shows up
The cross product is everywhere that three-dimensional geometry meets computation. In computer graphics and 3D modeling, the cross product of two edges of a triangle gives the surface normal — the perpendicular direction used to compute lighting, shading, and which way a face points. Rendering engines call it billions of times per frame.
In physics, torque is the cross product of a position vector and a force, r × F, capturing how a force twists an object about a pivot. Angular momentum and the magnetic force on a moving charge (the Lorentz force) are cross products too. In robotics and navigation, cross products help compute rotations and orientations. And in pure mathematics, the cross product defines area, tests whether vectors are coplanar, and builds coordinate frames. Any time you need a direction perpendicular to two others, the cross product is the tool.
The connection to machine learning is more subtle than the dot product’s, but it is real. Many geometric-deep-learning and 3D-vision pipelines operate on point clouds and meshes, where surface normals computed with the cross product become input features for a network. Pose estimation, camera calibration, and physics-informed simulators all lean on cross products to describe orientation and rotation. Even when a model never calls the operation directly, the training data — normals, tangent frames, angular quantities — is frequently generated by it upstream. Understanding the cross product therefore helps you read and debug the geometric preprocessing that feeds so many spatial models.
Frequently asked questions
Does the cross product only work in 3D?
Yes. The standard cross product that returns a vector perpendicular to both inputs exists only for three-dimensional vectors. There is a related seven-dimensional construction, but for everyday use the cross product means 3D, which is why this calculator requires exactly three numbers per vector.
Why is a × b different from b × a?
The cross product is anti-commutative: a × b = −(b × a). The two results have the same length but point in opposite directions, because the right-hand rule reverses when you swap the vectors.
What does the magnitude of the cross product tell me?
Its magnitude equals |a| |b| sin(theta), which is exactly the area of the parallelogram with sides a and b. It is largest when the vectors are perpendicular and zero when they are parallel.
What does it mean if the cross product is the zero vector?
A zero result means the two vectors are parallel (or one is the zero vector). Parallel vectors do not define a unique plane, so there is no single perpendicular direction to return.
How is the cross product different from the dot product?
The dot product returns a single number and measures how much two vectors point the same way. The cross product returns a vector perpendicular to both and measures the area they span. Different outputs, different uses.
Related calculators
Explore the full linear algebra calculators hub, or jump to the dot product calculator and the matrix multiplication calculator to keep building your toolkit.