Cross Product Calculator
a × b with i, j, k determinant steps, magnitude, unit normal, angle and area, plus triple products.
This vector calculator finds the dot product a · b = a₁b₁ + a₂b₂ + … + aₙbₙ of two vectors with 2 to 6 components, then the angle between them, each magnitude and unit vector, the scalar and vector projections, and the sum and difference, all kept exact.
Dot product a · b
a · b = 4. It is positive, so the vectors point in broadly the same direction: the angle between them is 63.61220004°.
Dot product
Multiply matching components and add the products.
Interpret the sign
The dot product is positive, so the angle between the vectors is acute (less than 90°).
For a × b with the i, j, k determinant, use the cross product calculator.
Dot product and the angle between two vectors
Plain-text formula: vec(a) · vec(b) = a_1b_1 + a_2b_2 + ⋯ + a_nb_n, cos θ = (vec(a) · vec(b))/(|vec(a)||vec(b)|)
The algebraic sum equals , which is how the angle is found. The dot product is 0 exactly when the vectors are perpendicular.
Magnitude and unit vector
Plain-text formula: |vec(a)| = √(a_1^2 + ⋯ + a_n^2), a^ = vec(a)/|vec(a)|
The magnitude is the length (Euclidean norm). Dividing by it gives a vector of length 1 in the same direction, which is undefined for the zero vector.
Projection of a onto b
Plain-text formula: comp_vec(b)vec(a) = (vec(a) · vec(b))/|vec(b)|, proj_vec(b)vec(a) = (vec(a) · vec(b))/|vec(b)|^2 vec(b)
The scalar projection is the signed length of the shadow of a on the line through b; the vector projection is that shadow as a vector.
Sum and difference
Plain-text formula: vec(a) ± vec(b) = (a_1 ± b_1, ;a_2 ± b_2, ;…, ;a_n ± b_n)
Vectors add and subtract component by component. In 2D, a + b is the diagonal of the parallelogram on a and b.
The sign of the dot product tells you the type of angle: positive means acute (under 90°), zero means perpendicular, negative means obtuse. The angle itself is always between 0° and 180°.
The dot product is a number, not a vector, and the order does not matter: . The cross product, by contrast, is a vector that flips sign when you swap the order.
A zero vector has length 0 and no direction, so the angle, the unit vector and projection onto it are undefined. The calculator says so instead of returning a misleading number.
Multiply the matching components and add the products. For a = (1, 2, 2) and b = (2, −1, 2): .
The same rule works in any dimension, as long as both vectors have the same number of components. In 4D, (1, 2, 3, 4) · (1, 0, 1, 0) = 1 + 0 + 3 + 0 = 4.
Divide the dot product by the product of the lengths and take the inverse cosine: . For a = (1, 2, 2) and b = (2, −1, 2), the dot product is 4 and both lengths are 3, so and (about 1.1102 radians).
The cross product gives the same angle from the other side: . Use the dot product form in practice, because arcsine cannot tell an acute angle from an obtuse one.
Both products multiply two vectors, but they answer different questions. The dot product measures how much two vectors point the same way; the cross product measures how much they turn away from each other, and in which direction. The cross product calculator shows the i, j, k determinant, the right-hand rule and the triple products in full.
| Cross product | Dot product | |
|---|---|---|
| Result | A vector | A number (scalar) |
| Dimensions | 3D (2D as the plane z = 0) | Any number of components |
| Size | ||
| Zero when | The vectors are parallel | The vectors are perpendicular |
| Order | ||
| Typical use | Normal vectors, areas, torque | Angles, projections, work |
Work. A constant force moving an object along does work . Only the part of the force along the motion counts.
Perpendicular tests. Two nonzero vectors are perpendicular exactly when their dot product is 0, which is the quickest way to check right angles in coordinate geometry.
Projections and shadows. The projection of a onto b splits a into a part along b and a part at right angles to it, as in resolving forces on a slope.
Similarity of data. Cosine similarity, , compares the direction of two lists of numbers and is widely used in search and recommendation systems.
Find a · b and the angle between a = (1, 2, 2) and b = (2, −1, 2).
Answer: a · b = 4 and the angle between the vectors is about 63.61°.
Multiply the matching components of the two vectors and add the results. For (1, 2, 2) and (2, −1, 2) that is 2 − 2 + 4 = 4. Both vectors must have the same number of components.
Divide the dot product by the product of the two lengths and take the inverse cosine: θ = arccos(a · b / (|a||b|)). For (1, 2, 2) and (2, −1, 2), cos θ = 4/9, so θ ≈ 63.61°.
The vectors are perpendicular (orthogonal), as long as neither is the zero vector. For example, (2, 1) · (−1, 2) = −2 + 2 = 0, so these vectors meet at exactly 90°.
The scalar projection is a number: the signed length of a’s shadow along b. The vector projection is that length times the unit vector of b. For a = (1, 2, 3, 4) and b = (1, 0, 1, 0), the scalar projection is 2√2 and the vector projection is (2, 0, 2, 0).
Divide each component by the vector’s magnitude. For (3, 4, 12) the magnitude is √(9 + 16 + 144) = 13, so the unit vector is (3/13, 4/13, 12/13). The zero vector has no unit vector.
Yes, choose Cross product a × b for two 3D vectors. For the full i, j, k determinant steps, 2D vectors, fractions, the unit normal and the triple products of three vectors, use the cross product calculator.
a × b with i, j, k determinant steps, magnitude, unit normal, angle and area, plus triple products.
Exact determinants of 2x2 to 6x6 matrices by row reduction or cofactor expansion, with every step.
Multiply, add and subtract matrices up to 6 × 6, plus determinant, inverse, transpose and powers, exactly.
Eigenvalues, eigenvectors and the characteristic polynomial of a 2x2, 3x3 or 4x4 matrix, with every step.
Midpoint of two points in 2D or 3D, with steps, distance, a graph and the missing-endpoint solver.
Type or tap expressions with exact fractions, memory, variables, constants and complex mode.
Learn more: For typing vectors and matrices in the full calculator, read matrices and vectors.
Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?