The vector calculator above handles the six operations that come up constantly in physics, engineering, graphics and linear algebra: addition, subtraction, scalar multiplication, the dot product, the cross product and vector projection. It works in two or three dimensions, and alongside every answer it reports both magnitudes, the dot product, the angle between the two vectors, and the unit vector of whatever result you asked for.
Arb Digital builds free calculators for the arithmetic people repeat by hand, and vector work is a prime candidate because the errors are so easy to make and so hard to spot. A sign flipped in the second term of a cross product produces a perfectly plausible-looking vector pointing in entirely the wrong direction. Having the magnitude, the angle and the perpendicularity check on screen at the same time makes that kind of slip obvious.
What This Vector Calculator Does
A vector is a quantity with both magnitude and direction, as distinct from a scalar, which has magnitude only. Temperature is a scalar: 20 degrees is 20 degrees regardless of which way you face. Velocity is a vector: 20 metres per second north is a genuinely different thing from 20 metres per second east. NASA's Scalars and Vectors page draws the same distinction with aerodynamic examples, and it is the distinction that makes every operation on this page necessary — you cannot simply add two velocities the way you add two temperatures.
The tool represents each vector by its components along the coordinate axes. Vector a with components (3, −2, 5) means three units in the x direction, two units backwards along y, and five units up z. Every operation here is defined component by component, which is what makes them practical to compute and what NASA's Vector Addition page describes when it adds the x-components to get the x-component of the result and the y-components to get the y-component.
One boundary worth stating: this page operates on individual vectors. Our matrix calculator handles arrays of numbers and the operations defined on them — multiplication, transposition, systems of equations — which is a related but separate job. If your vectors are columns of a matrix, that is the page you want.
How to Use It
- Choose 2D or 3D. In 2D the z fields are ignored. Switch to 3D before attempting a cross product, which is only defined in three dimensions.
- Type the components of vector a and vector b. Negative values and decimals are both fine. If you have a vector expressed as a magnitude and an angle, convert it to components first: x = r·cos θ, y = r·sin θ.
- Pick the operation. Addition, subtraction, cross product, scalar multiple and projection all return a vector, shown as an ordered triple. The dot product returns a single number.
- Set the scalar k if you are scaling. A value of 2 doubles the length and keeps the direction; a value of −1 keeps the length and reverses it entirely.
- Read the supporting grid. The two magnitudes, the dot product and the angle between the vectors update on every operation, so the geometric picture is always in view even when you asked for something else.
The Formula / How It's Calculated
Addition and subtraction work component by component: a + b = (aₓ + bₓ, a_y + b_y, a_z + b_z). With a = (3, −2, 5) and b = (1, 4, −2), the sum is (4, 2, 3). Scalar multiplication multiplies every component: k·a = (kaₓ, ka_y, ka_z), so 2a = (6, −4, 10).
The dot product is a · b = aₓbₓ + a_yb_y + a_zb_z, a single number. For the same vectors: (3)(1) + (−2)(4) + (5)(−2) = 3 − 8 − 10 = −15. It also equals |a||b|cos θ, which is how the angle is recovered. Here |a| = √(9 + 4 + 25) = √38 ≈ 6.1644 and |b| = √(1 + 16 + 4) = √21 ≈ 4.5826, so cos θ = −15 ÷ 28.2489 = −0.5310 and θ ≈ 122.07°. The negative dot product tells you immediately that the angle is obtuse.
The cross product returns a vector perpendicular to both inputs: a × b = (a_yb_z − a_zb_y, a_zbₓ − aₓb_z, aₓb_y − a_ybₓ). Working the same pair: the x component is (−2)(−2) − (5)(4) = 4 − 20 = −16; the y component is (5)(1) − (3)(−2) = 5 + 6 = 11; the z component is (3)(4) − (−2)(1) = 12 + 2 = 14. So a × b = (−16, 11, 14). Finally, the projection of a onto b is (a · b ÷ |b|²)·b, which strips a down to the part that points along b.
Dot Product Versus Cross Product
These two are constantly confused because both take two vectors and both involve products of components, but they answer opposite questions. The dot product measures how much two vectors point the same way. It is largest when they are parallel, zero when they are perpendicular, and negative when they point more than ninety degrees apart. It returns a scalar, so it has no direction of its own.
The cross product measures how much two vectors fail to point the same way. Its magnitude is |a||b|sin θ, which is zero for parallel vectors and largest for perpendicular ones — exactly inverted from the dot product. It returns a vector, aimed perpendicular to the plane containing a and b, with its sense given by the right-hand rule.
The order matters for one and not the other. The dot product is commutative: a · b equals b · a always. The cross product is anti-commutative: a × b = −(b × a). Swapping the operands flips the result through 180 degrees, which is one of the most common sources of sign errors in physics problems involving torque or magnetic force.
What the Cross Product Is Actually For
Two geometric facts make the cross product indispensable. First, its magnitude equals the area of the parallelogram spanned by the two vectors, so half of it is the area of the triangle they define. That gives you a direct way to compute the area of a triangle in three-dimensional space from its vertices, without dropping perpendiculars or finding a base — a job our triangle area calculator handles in the plane.
Second, the resulting vector is perpendicular to the original plane, which makes it the standard way to find a surface normal. Every lighting calculation in 3D graphics depends on surface normals, and almost all of them are produced by crossing two edge vectors of a polygon. Get the operand order wrong and the normal points into the surface instead of out of it, and the object renders black.
In physics the cross product defines torque as r × F and the magnetic force as qv × B. In both cases the perpendicular result is not a mathematical convenience but a description of how the physical system actually behaves. The right-hand rule — point the fingers along a, curl them towards b, and the thumb gives the direction of a × b — is the standard mnemonic, and it is worth checking against the calculator the first few times.
Magnitude, Unit Vectors and Direction Angles
The magnitude of a vector is the Pythagorean length of its components: |a| = √(aₓ² + a_y² + a_z²). It is always non-negative, and it discards direction entirely, which is why a magnitude alone is a scalar.
Dividing a vector by its own magnitude produces the unit vector, which has length exactly one and carries the direction and nothing else. This normalisation is one of the most-used operations in graphics and robotics: when you only care where something points, the unit vector is what you store. The calculator reports it for whatever result you compute. Note the one failure case — the zero vector has no direction, and dividing by its magnitude of zero is undefined, so the tool reports it as such rather than returning meaningless numbers.
Direction angles are the angles between the vector and each coordinate axis, obtained from the cosine of each component divided by the magnitude. Their cosines are the direction cosines, and squaring and summing them always gives exactly one — a useful arithmetic check. In two dimensions the more common convention is a single bearing measured anticlockwise from the positive x axis, which is what the calculator shows in 2D mode; the angle converter will move that between degrees, radians and gradians if you need it in another unit.
Where Vector Arithmetic Goes Wrong
The most frequent error is adding magnitudes rather than vectors. Two forces of 10 newtons do not produce 20 newtons unless they point in exactly the same direction. At right angles they produce √(100 + 100) ≈ 14.1 newtons; in opposition they produce zero. Magnitude is not additive, and treating it as though it were is the single biggest source of wrong answers in introductory mechanics.
The second is mixing units or coordinate frames. Components measured in different units, or vectors expressed relative to different reference frames, cannot be combined until they are converted to a common basis. A velocity relative to a moving vehicle and a velocity relative to the ground describe different things, and adding them componentwise is only valid after one has been transformed.
The third is losing track of what an operation returns. Setting a dot product equal to a vector, or trying to take the magnitude of a scalar result, produces a type error that no amount of arithmetic care will fix. When a cross product appears in two dimensions, what is usually meant is the scalar aₓb_y − a_ybₓ — the z component of the 3D cross product with both z values set to zero — and this calculator returns exactly that when you ask for a cross product in 2D mode. For the closely related determinant that quantity represents, see the determinant calculator.
Arb Digital builds free, no-signup calculators for mathematics, statistics, finance and construction. Browse the full library, or get in touch if there is a calculation your team keeps doing by hand.
Browse All Free Tools Contact Arb DigitalCommon Mistakes to Avoid
- Adding magnitudes instead of components — two 10-unit forces at right angles combine to about 14.1 units, not 20.
- Reversing the operands of a cross product — a × b and b × a point in opposite directions, which flips torques, normals and magnetic forces.
- Attempting a cross product in two dimensions — the true cross product needs three, and what is wanted in 2D is the scalar aₓb_y − a_ybₓ.
- Normalising the zero vector — it has no direction, so dividing by its zero magnitude is undefined rather than simply awkward.
- Reading a negative dot product as an error — it is a valid and informative result meaning the angle between the vectors exceeds ninety degrees.
Related Free Tools From Arb Digital
Work with arrays rather than single vectors in the matrix calculator, find the scalar that measures a transformation's volume change with the determinant calculator, invert a system with the matrix inverse calculator, find characteristic directions with the eigenvalue calculator, and switch angle units with the angle converter. For the gradient of a line in the plane, the slope calculator is the quicker route. The full free online tools hub holds the rest of the mathematics set.
Frequently Asked Questions
Add them component by component. The x component of the sum is the sum of the two x components, and the same for y and z. With a as (3, −2, 5) and b as (1, 4, −2), the sum is (4, 2, 3).
The dot product returns a single number measuring how much two vectors point in the same direction, and it is zero when they are perpendicular. The cross product returns a vector perpendicular to both, whose length measures how much they differ in direction, and it is zero when they are parallel.
Divide the dot product by the product of the two magnitudes, then take the inverse cosine. A positive dot product gives an acute angle, zero gives exactly ninety degrees, and a negative value gives an obtuse angle.
Not in the strict sense, because the cross product is only defined in three dimensions. In two dimensions the usual substitute is the scalar quantity ax·by minus ay·bx, which is the z component of the 3D cross product when both z values are zero.
A vector of length exactly one that points in the same direction as the original. You get it by dividing each component by the vector's magnitude. It is undefined for the zero vector, which has no direction to preserve.
It means the angle between the two vectors is greater than ninety degrees, so they point in broadly opposing directions. It is a normal result, not an error, and it is how the calculator identifies obtuse angles.
It splits a vector into the part that lies along another vector and the part perpendicular to it. That is how you resolve a force into a component along a slope and a component pressing into it, and how least-squares fitting decomposes data onto a model.
Because direction matters. Two vectors only add their lengths when they point exactly the same way. At any other angle, part of each cancels the other, and at right angles the result follows Pythagoras rather than simple addition.
This calculator is provided for education and planning only. Results should be checked against your own working, and for consequential engineering decisions reviewed by someone qualified in your field.