Cross Product Calculator
Result
x component of u × v
- y component of u × v
- 6.0000
- z component of u × v
- -3.0000
- Magnitude of u × v
- 7.3485
A cross product calculator takes two three-dimensional vectors and returns the vector perpendicular to both, written out as its x, y and z components together with the length of that resulting vector. Type each vector as three numbers separated by spaces or commas — 1 2 3 and 4 5 6 — in either order of the two boxes, and the page does the rest. Three numbers each is not a simplification but the definition: the cross product exists in three dimensions (and, by a different construction, in seven), and there is no cross product of two-dimensional vectors to compute. Each component comes from one difference of two products. The x component is the first vector's second component times the second vector's third, minus its third times the second vector's second. The y component repeats that pattern shifted one place round, and the z component shifts it once more. The cyclic order is the thing to keep straight, and confusing it is what produces a sign error in one component rather than an obviously wrong answer. Two properties are worth knowing before you use the output. The result points at right angles to both inputs, so it is the natural way to get a normal to a surface or to a plane spanned by two directions. And the order matters: swap the two vectors and every component of the answer flips sign, while the length stays the same. That is the right-hand rule in arithmetic form, and this page will show it to you directly if you enter the same pair of vectors twice with the boxes swapped. The same formula has a second reading that is often more useful than the vector itself: the length of the cross product is the area of the parallelogram the two vectors span, which is exactly twice the area of the triangle with those two sides. A cross product whose length is zero therefore means the two vectors are parallel — they span no area at all — and that is also the case that gives three zeros back.
Vector pairs and their cross products
| Vector u | Vector v | x component of u × v | y component of u × v | z component of u × v | Magnitude of u × v |
|---|---|---|---|---|---|
| 1 2 3 | 4 5 6 | -3 | 6 | -3 | 7.3485 |
| 1 0 0 | 0 1 0 | 0 | 0 | 1 | 1 |
| 0 1 0 | 1 0 0 | 0 | 0 | -1 | 1 |
| 0 0 1 | 1 0 0 | 0 | 1 | 0 | 1 |
| 1 2 3 | 2 4 6 | 0 | 0 | 0 | 0 |
| 0 0 0 | 1 2 3 | 0 | 0 | 0 | 0 |
| 3 4 0 | 4 3 0 | 0 | 0 | -7 | 7 |
| 2 -3 1 | 4 5 6 | -23 | -8 | 22 | 32.8177 |
Eight pairs, and the whole page's argument is spread across them. The first row is the one the page loads with and the second is the plainest example there is: the unit vector along x crossed with the one along y gives the one along z, length 1. The third row is the second with the two columns exchanged, and the fourth completes the cycle, which is the entire cyclic order of this operation demonstrated in three lines. The fifth row is two parallel vectors, giving three zeros and a length of zero: parallel vectors span no area. The sixth row is the zero vector, and it is in the table on purpose — the page accepts it, unlike the dot product and angle pages, because there is a true answer here rather than a division to avoid. Those two rows look identical and mean different things, which is the one ambiguity the page cannot resolve for you. The seventh row is a pair lying in the flat plane: the answer is straight out of it, only the third component is non-zero, and the length of 7 is the area of the parallelogram with these two as sides. The eighth row is the untidy one with mixed signs, where all three components are non-zero — the row to compare against if you work one out by hand and want to know whether your sign pattern is right. Every figure is recomputed when the page is built, and the spaces inside the first two columns are the separators, not part of the numbers.
Formula
u × v = (u₂v₃ − u₃v₂, u₃v₁ − u₁v₃, u₁v₂ − u₂v₁) |u × v| = |u| × |v| × sin θ = 平行四边形的面积
- 向量 u
- The first vector: exactly three numbers, separated by spaces or commas, such as 1 2 3. Three is the only count accepted, because the cross product is a three-dimensional operation — a two-dimensional pair is refused rather than padded with a zero, which would silently change the answer
- 向量 v
- The second vector, also exactly three numbers. The order of the two vectors matters here in a way it does not for a dot product: swapping them flips the sign of every component of the answer
- x component
- The first component of the answer: the first vector's second component times the second vector's third, minus its third times the second vector's second. Every component of a cross product is a difference of two products, which is where the signs come from
- y component
- The same pattern shifted once around: the first vector's third component times the second vector's first, minus its first times the second vector's third. Getting this shift wrong is the commonest mistake — it does not produce an absurd answer, just one component with the wrong sign
- z component
- The pattern shifted once more: the first vector's first component times the second vector's second, minus its second times the second vector's first. The three components together are the vector that is perpendicular to both inputs
- Magnitude
- The length of the resulting vector: the square root of the sum of the squares of the three components. It is also the area of the parallelogram the two input vectors span, and twice the area of the triangle with those two sides — which is usually the more useful way to read it
- |u| × |v| × sin θ
- The same length written from the other side, with θ the angle between the two inputs. It says the length is largest when the two vectors are perpendicular and falls to zero as they come into line, which is why a cross product of zero means parallel — and why the dot product, which behaves in exactly the opposite way, is the complement of this page
- Perpendicular to both
- The property that makes the output worth having: the result is at right angles to each of the two inputs. Checkable in the output by taking either dot product — both are zero, to rounding
- Four decimal places
- How wide the outputs are written. The components are exact whenever the inputs are whole numbers and small, which covers most hand calculations; where they are not, the figures are rounded
The cross product answers a different question from the dot product, and the two are complements rather than alternatives. The dot product takes two vectors and gives a number that is largest when they point the same way; the cross product takes two vectors and gives a vector that is longest when they are perpendicular. Use this one when you need a direction at right angles to two known directions — the normal to a surface, the axis a rotation is about, the direction a magnetic force pushes a moving charge. Use it when you want the area of a parallelogram or a triangle from two side vectors: the length of the answer is the parallelogram's area, so half of it is the triangle's. Use it when you want to test whether two vectors are parallel, since the answer is three zeros exactly when they are. And use it when you need the perpendicular direction in the right orientation, which is where the order of the two vectors and the right-hand rule come in: the first vector is the one your fingers curl away from and the second the one they curl towards, with the thumb giving the answer. Two cautions. The result is perpendicular to both inputs, so it is not a direction either input was pointing — if you were expecting an answer along one of them, you wanted the dot product. And a length of zero is a real answer, not a failure: it says the two vectors are parallel, including the case where one of them is the zero vector.
Worked examples
1 2 3 and 4 5 6
- x component: 2 × 6 − 3 × 5 = 12 − 15 = −3
- y component: 3 × 4 − 1 × 6 = 12 − 6 = 6
- z component: 1 × 5 − 2 × 4 = 5 − 8 = −3
- Magnitude: √(9 + 36 + 9) = √54 = 7.348469
The input the page loads with, and the row that shows how ordinary the arithmetic is: three differences of two products and nothing else. All three components are non-zero, which makes this the most useful row for checking a manual worked step against the page, since a sign error cannot be hidden by a zero. The length, 7.3485, is the area of the parallelogram these two vectors span — the triangle with these two sides has half of it.
1 0 0 and 0 1 0
- x component: 0 × 0 − 0 × 1 = 0
- y component: 0 × 0 − 1 × 0 = 0
- z component: 1 × 1 − 0 × 0 = 1
- Magnitude: √(0 + 0 + 1) = 1
The unit vectors along the first two axes, and the cross product comes back as the third one. This is the row that shows the cyclic order the page is built on: x cross y is z, and the length of 1 says the two inputs were perpendicular and the parallelogram is a unit square. Writing the three components out by hand here is worth doing once — it is the case where every term that should vanish does.
0 1 0 and 1 0 0
- x component: 1 × 0 − 0 × 0 = 0
- y component: 0 × 1 − 0 × 0 = 0
- z component: 0 × 0 − 1 × 1 = −1
- Magnitude: √(0 + 0 + 1) = 1
The previous row with the two boxes swapped, and the whole difference is the sign of the third component. That is the order-dependent property of this operation, and this page demonstrates it without any algebra: enter the same pair twice, swap the boxes, watch one component change sign. The length is unchanged at 1, which is the other half of the statement — swapping the two vectors reverses the direction of the answer but not its size.
1 2 3 and 2 4 6
- x component: 2 × 6 − 3 × 4 = 12 − 12 = 0
- y component: 3 × 2 − 1 × 6 = 6 − 6 = 0
- z component: 1 × 4 − 2 × 2 = 4 − 4 = 0
- Magnitude: √(0 + 0 + 0) = 0
Two vectors pointing along the same line — the second is exactly twice the first — and the answer is three zeros. This is the parallel case, and it is the one worth recognising, because the length of a cross product is the area the two vectors span and parallel vectors span no area. Getting all zeros back is a correct answer, not a failure: it says the two directions are the same line, and no vector is perpendicular to that line in the way a surface normal would be.
3 4 0 and 4 3 0
- x component: 4 × 0 − 0 × 3 = 0
- y component: 0 × 4 − 3 × 0 = 0
- z component: 3 × 3 − 4 × 4 = 9 − 16 = −7
- Magnitude: √(0 + 0 + 49) = 7
Two vectors lying in the flat plane, so the perpendicular direction is the one straight out of it and the first two components are zero. The length of 7 is the area of the parallelogram with these two as sides, and the triangle with these two sides has 3.5. The sign of the third component tells you which side of the plane the answer points to, and it is negative here because the first vector is the one that swings into the second anticlockwise when seen from the other side. Both of these vectors have length 5, their dot product is 24, and 7, 24 and 25 are a Pythagorean triple — which is another way of saying the length here and the dot product are the two legs of a right triangle whose hypotenuse is the product of the two lengths.
Limitations
Both vectors must have exactly three components, and a pair with two or four is refused rather than padded. There is no two-dimensional cross product: the operation is three-dimensional by definition, and quietly adding a zero to make a two-dimensional pair fit would produce a direction that has nothing to do with the plane the two vectors lie in. Components are read as ordinary numbers: a comma followed by a space separates components, a comma with no space after it is read as a decimal point (1,5 is one and a half), and a thousands grouping is refused rather than guessed at — write 1500, not 1,500. Four decimal places is a display width rather than a claim about precision. The zero vector is accepted here, unlike on the dot product and angle pages, and that difference is deliberate: a cross product with the zero vector really is the zero vector, because the zero vector spans no area with anything, so there is a true answer to give rather than a calculation to decline. Getting three zeros back is therefore ambiguous in a way the page cannot resolve for you — it means the two vectors are parallel, and it also means one of them is the zero vector, and only you know which. Both cases are correct outputs. There is no units handling: the components are plain numbers and so is the length of the answer, though the length does carry whatever unit the inputs were squared into. Nothing on the page checks the orientation of the result against a physical right hand, so if you are using the output as a normal or a rotation axis, the order the two vectors were entered in is what decides which of the two perpendicular directions you get.
Frequently asked questions
- Why can't I enter two-dimensional vectors?
- Because there is no cross product of two vectors in a plane. The operation is defined in three dimensions — the answer has to be perpendicular to both inputs, and in a flat plane there is no direction left over for it to point in. Padding a two-dimensional pair with a zero to make it fit would produce an answer that has nothing to do with the plane, so the page refuses instead.
- What does the answer mean geometrically?
- It is the vector at right angles to both inputs, and its length is the area of the parallelogram the two inputs span. Half that length is the area of the triangle with those two sides. That double reading is why the same calculation turns up both when you want a surface normal and when you want an area.
- I got three zeros. Did something go wrong?
- No — a zero cross product is a real answer. It means the two vectors are parallel, spanning no area, and it also comes back when one of them is the zero vector. Both are correct results rather than failures, and the page has no way to tell you which case you are in, since both produce the same three zeros.
- Does the order of the two vectors matter?
- Yes, and it is the one place this page differs sharply from the dot product page. Swapping the two vectors reverses the direction of the answer: every component changes sign, while the length stays exactly the same. Enter the same pair twice with the boxes swapped and you can watch it happen. Which of the two perpendicular directions you want is decided by the right-hand rule.
- Which component comes first?
- The x component, then y, then z, and the answer is printed as a vector just the way the inputs were typed in. Each one is a difference of two products, with the pattern shifting one place around the cycle for each: the y component repeats the x recipe with the components cycled, and the z component cycles once more.
- How is this different from the dot product?
- The dot product takes two vectors and gives one number, largest when the two point the same way; the cross product gives a vector, longest when they are perpendicular. They are complements. If you wanted a single number — an angle, a projection, a similarity — you want the dot product; if you wanted a direction at right angles to both, you want this page.
References
- Cross product — the operation this page computes, with the component-by-component definition and the two properties the page leans on, that the result is perpendicular to both inputs and that the order of the factors flips its sign — Wolfram MathWorld (United States)
- Determinant — the array of numbers whose evaluation is exactly the cross product's component formulas, which is why the same cycle turns up in both places and why this page points at the matrix calculator — Wolfram MathWorld (United States)
- Parallelogram — the figure whose area the length of a cross product gives, and the reason the answer is three zeros exactly when the two vectors are parallel — Wolfram MathWorld (United States)
- 教育部关于印发义务教育课程方案和课程标准(2022 年版)的通知——The fifth item in the annex list of this notice is the Mathematics Curriculum Standards for Compulsory Education (2022 edition); space vectors and their operations do not fall in the compulsory-education grade bands, and the wording of the standards and the grade-band breakdown are governed by that annex — 中华人民共和国教育部