3D Vector Calculator | Magnitude, Unit Vector, Dot, Cross, and Angle at Once
Type two 3D vectors A=(x, y, z) and B=(x, y, z) and see both magnitudes, unit vectors, the dot product A·B, the cross product A×B with |A×B|, and the angle θ° side by side. Switch precision from 2 to 8 decimals.
💡 About this tool
If you write game or graphics code, you already know the pain: you need a quick sanity check on a normal, a dot product, and an angle, but every online calculator does only one operation. You end up retyping the same components into three different tabs, and that is exactly where a sign flip or a swapped y/z sneaks in.
This tool runs the five operations from one input. Enter A and B once and you get |A| and |B|, the normalized unit vectors  and B̂, the dot product, the cross product plus its magnitude |A×B|, and the angle between them. Because |A×B| equals the area of the parallelogram the two vectors span, the same number doubles as a surface-area or triangle-area check.
Verifying a glm::cross result, debugging a lighting normal, or just checking your linear-algebra homework — bump the precision up to 8 decimals to match a unit test, or drop it to 2 for a readable approximation. The input never changes; only the displayed precision does.
🧐 Frequently Asked Questions
What is the difference between the dot product and the cross product? The dot product A·B is a scalar (a single number) that tells you how aligned two vectors are. The cross product A×B is a vector pointing perpendicular to both A and B. Use the dot product for angles and projections, and the cross product for normals, torque, and area.
Why does the angle show "N/A"? If either vector is the zero vector (magnitude 0), the angle is undefined. A zero vector has no direction, so the denominator in cos θ = (A·B)/(|A||B|) becomes 0 and the result cannot be computed.
My dot product came out as 0 — what does that mean? The two vectors are orthogonal, i.e. perpendicular at exactly 90°. The angle field should read 90.00°, so a zero dot product is a fast perpendicularity test.
What is a unit vector and why would I want one? A unit vector keeps the direction but scales the length to 1, computed as  = A / |A|. It is what you feed into lighting math, movement direction, or any place where only the direction matters, not the length.
Does changing the decimals change my answer? No. The decimal selector only changes how many digits are shown. Use 6–8 decimals to match a unit test or catch floating-point drift, and 2–4 for a clean readable value.
📚 Why the cross product only lives in 3D
The cross product is one of the few operations that only exists in 3D (and, surprisingly, 7D). In 2D there is no room for a vector perpendicular to a plane that still lies inside that plane, which is why 2D "cross products" are treated as a scalar instead. Its magnitude, |A×B| = |A||B|sin θ, equals the area of the parallelogram spanned by A and B — halve it and you have the triangle area, a trick used constantly in mesh and collision code.
The direction of A×B follows the right-hand rule: point your fingers along A, curl them toward B, and your thumb points along A×B. Flip the order to B×A and the result negates, which is why cross products are anti-commutative. That ordering matters in graphics: getting it backward gives you inverted face normals and a mesh that lights from the wrong side.