Dot Product, Cross Product, Magnitude & Angle
Updated October 2026
Enter two vectors by their components and this tool computes the operations you actually need: the dot product, the cross product, each vector's magnitude, the angle between them, and their sum. It works for 2D vectors (leave the z components at zero) and full 3D vectors. Every result updates from the same set of inputs, so you can see how the pieces relate.
Vectors are the language of physics and engineering — force, velocity, displacement, and fields are all vectors. The two products below answer two different geometric questions, and mixing them up is one of the most common sources of confusion, so it's worth being clear about what each one means.
The dot product (A · B) returns a single number — a scalar. It measures how much two vectors point in the same direction. When it's zero, the vectors are perpendicular; when it's large and positive, they're closely aligned. It's the basis for finding the angle between vectors and for projecting one vector onto another.
The cross product (A × B) returns a new vector, perpendicular to both inputs, and only exists in three dimensions. Its magnitude equals the area of the parallelogram the two vectors span, and its direction follows the right-hand rule. It's how you find a normal vector to a plane, compute torque, or get the axis of rotation.
The angle comes straight from the dot product: cos θ = (A · B) / (|A| |B|). This calculator does that step for you and reports the angle in degrees. A result of 90° confirms the vectors are orthogonal; 0° means they're parallel and pointing the same way; 180° means they point in opposite directions. If you work with slopes and lines in 2D, the slope calculator is a useful companion.
A vector's magnitude — its length — is just the Pythagorean theorem extended to as many dimensions as you have: the square root of the sum of the squared components. For (3, 4, 0) that's √(9 + 16) = 5. The magnitude turns a direction-and-size object back into a plain length, which is what you need when a problem asks "how fast" or "how far" rather than "which way."
Suppose you are working with two force vectors in three dimensions: A = (2, 3, 6) and B = (1, 2, 2). Walking through every operation by hand shows exactly what the calculator does internally. Start with the magnitudes, since several later steps depend on them. The magnitude of A is √(2² + 3² + 6²) = √(4 + 9 + 36) = √49 = 7. The magnitude of B is √(1² + 2² + 2²) = √(1 + 4 + 4) = √9 = 3. Clean whole numbers here are a coincidence of the example, but they make the arithmetic easy to follow.
Next, the dot product. Multiply matching components and add: (2)(1) + (3)(2) + (6)(2) = 2 + 6 + 12 = 20. Because the dot product is positive and fairly large relative to the magnitudes, you already know the two vectors point in broadly similar directions. To turn that intuition into a precise angle, divide the dot product by the product of the magnitudes: 20 ÷ (7 × 3) = 20 ÷ 21 ≈ 0.952. The angle is the inverse cosine of that value, cos⁻¹(0.952) ≈ 17.75°. The vectors are nearly aligned, which matches the large positive dot product.
The cross product takes a little more care because each component is a small determinant. The x component is (3)(2) − (6)(2) = 6 − 12 = −6. The y component is (6)(1) − (2)(2) = 6 − 4 = 2. The z component is (2)(2) − (3)(1) = 4 − 3 = 1. So A × B = (−6, 2, 1). As a check, this result vector should be perpendicular to both inputs — and indeed its dot product with A is (−6)(2) + (2)(3) + (1)(6) = −12 + 6 + 6 = 0, confirming perpendicularity. The magnitude of the cross product, √((−6)² + 2² + 1²) = √(36 + 4 + 1) = √41 ≈ 6.40, equals the area of the parallelogram the two vectors span. Entering these same vectors into the calculator returns exactly these figures instantly.
These calculations are not abstract exercises — each maps to a concrete physical or computational task. The dot product is the workhorse of physics and graphics. When you compute the work done by a force, you take the dot product of the force vector and the displacement vector, because only the component of force along the direction of motion does any work. In 3D graphics and game engines, the dot product between a surface normal and a light direction determines how brightly a surface is lit, which is the basis of nearly all real-time shading.
The cross product answers a different family of questions, all involving rotation or orientation. Torque — the twisting force on a wrench or a bolt — is the cross product of the lever-arm vector and the applied force, which is why pushing perpendicular to a wrench handle is far more effective than pushing along it. In computer graphics, the cross product of two edges of a triangle produces the surface normal, the perpendicular direction a polygon faces, which feeds directly back into those lighting calculations. Navigation and robotics use cross products to compute axes of rotation when reorienting a body in space.
A common source of error worth flagging is order and orientation. The dot product is commutative — A · B equals B · A — so order never matters there. The cross product is the opposite: A × B points in exactly the opposite direction to B × A. Reversing the order flips the sign of every component. If a calculation involving torque, rotation, or a surface normal comes out pointing the wrong way, a swapped cross-product order is the first thing to check. The other frequent slip is mixing 2D and 3D carelessly; when working in a plane, keep the z components at zero rather than dropping them, so the cross product still has a well-defined direction to point along. For related plane-geometry work, the slope calculator handles two-dimensional lines directly.
Leave both z components at zero to work entirely in 2D — every operation except the cross product behaves exactly as it would on paper.
If the dot product comes out to zero, your vectors are perpendicular. It’s the fastest orthogonality check there is.
The cross product’s magnitude equals the area of the parallelogram the two vectors form — handy for geometry problems, not just physics.
Remember the cross product is not commutative: A × B points opposite to B × A. Order matters, so keep your vectors in the intended sequence.