Vector Calculator
Add, subtract, dot and measure two three-dimensional vectors.
Vectors are everywhere once you start looking for them. A wind blowing east at a certain speed, a force pushing a box across a floor, or a drone climbing while it moves forward all need both a size and a direction to describe them. That pairing of size and direction is exactly what a vector is, and this Vector Calculator lets you work with two three-dimensional vectors quickly and correctly. Enter the three components of vector A and vector B, choose an operation, and you get the answer together with the component arithmetic behind it.
Doing vector work by hand is simple in principle but easy to spoil with one slipped sign or one swapped component. A single error in the second line can follow you through the rest of a physics problem, a graphics assignment, or an engineering calculation. The calculator removes that risk for the routine operations students and professionals use most often: addition, subtraction, the dot product, and magnitude.
What This Calculator Does
Each vector is described by three numbers called components: x, y, and z. The x component tells you how far the vector reaches along the left-to-right axis, the y component along the forward or upward axis, and the z component along the remaining axis, often depth or height. Together the three components pin down both how long the vector is and exactly where it points.
The calculator offers five operations. Addition combines two vectors component by component into a new vector. Subtraction finds the difference between them, which is useful when you want the vector that points from the tip of one vector to the tip of the other. The dot product multiplies matching components and adds the results, giving a single number that reveals how strongly the two vectors point in the same direction. Finally, the magnitude operations measure the length of vector A or vector B on its own.
Every result comes with a breakdown line that shows the actual numbers being added, subtracted, multiplied, or squared. That makes the tool useful for learning as well as for checking finished work, because you can follow each step and see exactly where your own hand calculation agrees or disagrees.
How to Use This Calculator
Start by typing the three components of vector A into the first row. Use negative numbers freely, since a negative component simply means the vector points in the negative direction along that axis. Then type the three components of vector B into the second row. All six fields are required, even when a component is zero, so enter 0 rather than leaving a box empty.
Next, pick the operation from the drop-down list. Choose addition or subtraction when you want a new vector as the answer, the dot product when you want a single number, and a magnitude option when you only need the length of one vector. Press Calculate and the result box appears with the main answer first and the step-by-step breakdown underneath. Press Reset at any time to clear the page and start a fresh problem.
One practical tip: keep your axes consistent. If vector A comes from a diagram where y points up, make sure vector B uses the same convention. Mixing two different coordinate systems is the most common reason a correct calculation still produces a useless answer.
The Formula and the Idea Behind It
Addition and subtraction work component by component. To add A and B, you compute (ax + bx, ay + by, az + bz). To subtract B from A, you compute (ax – bx, ay – by, az – bz). Nothing crosses between axes: the x components only ever meet the x components. Geometrically, addition places the tail of B at the tip of A, and the answer is the vector from the start of A to the end of B.
The dot product follows the rule ax times bx plus ay times by plus az times bz. The result is a scalar, a plain number with no direction. A large positive dot product means the vectors point broadly the same way, a value near zero means they are perpendicular, and a negative value means they point in generally opposite directions. Engineers use it to find work done by a force, and programmers use it for lighting and angle checks.
Magnitude is the three-dimensional version of the Pythagorean theorem. The length of A is the square root of ax squared plus ay squared plus az squared. Squaring removes any negative signs, the sum measures squared length along all three axes together, and the square root returns the true length in the original units.
Worked Example 1: The Magnitude of A = (3, 4, 0)
Take vector A = (3, 4, 0) and find its magnitude. Square each component: 3 squared is 9, 4 squared is 16, and 0 squared is 0. Add them: 9 + 16 + 0 = 25. Take the square root: the square root of 25 is 5. So |A| = 5.
This is the famous 3-4-5 right triangle hiding inside a vector. Because the z component is zero, the vector lies flat in the x-y plane, and its length is the hypotenuse of a triangle with sides 3 and 4. It is a handy sanity check: whenever two components form a 3-4 pair and the third is zero, the magnitude should come out to exactly 5, or a simple multiple of it.
Worked Example 2: Adding and Dotting A = (3, 4, 0) and B = (1, 2, 3)
Now keep A = (3, 4, 0) and add B = (1, 2, 3). For addition, combine matching components: 3 + 1 = 4, 4 + 2 = 6, and 0 + 3 = 3. So A + B = (4, 6, 3). Notice how the answer is still a vector with three components, because combining two journeys, forces, or displacements produces another journey, force, or displacement.
For the dot product of the same pair, multiply matching components and add: 3 times 1 is 3, 4 times 2 is 8, and 0 times 3 is 0. Then 3 + 8 + 0 = 11. So A . B = 11. The positive value tells you the two vectors lean in a similar general direction rather than opposing each other, and because neither vector is tiny, a value of 11 shows a moderate alignment rather than near-perfect agreement.
How to Read Your Results
Look first at the shape of the answer. Addition and subtraction return three numbers in brackets, a new vector. The dot product and magnitude return one number each, because both describe a property of direction or size rather than a new direction. If you expected a vector and got a single number, you probably selected the wrong operation.
Then read the breakdown line and compare it with your own working. It lists the exact pairs that were combined, so a mismatch points straight to the component you mistyped. Pay special attention to negative signs, which the breakdown preserves. A component shown as 3 – -2, for example, becomes 5, and that double negative is a classic place for hand calculations to go wrong.
Finally, sense-check the size. A magnitude can never be negative, and it should be at least as large as the biggest single component. A dot product, by contrast, can be negative, and that is meaningful information rather than an error.
Where Vectors Show Up in Real Life
Physics is the natural home of vectors. Velocity, acceleration, force, and momentum all have direction, so adding two forces acting on an object, or finding the work done when a force pushes along a displacement, is vector work. The dot product appears in the work formula directly: work equals the dot product of force and displacement, which is why only the part of the force along the movement counts.
Computer graphics and game development run on the same mathematics. Positions, movements, surface normals, and light directions are stored as three-component vectors. Magnitude normalizes a direction so an object moves at a steady speed, and the dot product decides how brightly a surface is lit by comparing its normal with the direction to the light. Navigation and robotics use vectors in the same way to combine movements and correct courses.
Common Mistakes to Avoid
The most frequent error is mixing up components, such as adding the x of one vector to the y of the other. Components only ever combine with their match. A second common slip is leaving a zero component blank instead of entering 0, which makes the problem unsolvable. A third is expecting the dot product to be a vector; it is always a single number.
Sign errors come next. Subtracting a negative component adds its value, so 3 – (-2) is 5, not 1. Also watch the order in subtraction: A – B is not the same as B – A; the second answer is the exact opposite vector. Finally, remember that magnitude uses squares, so a component of -4 contributes 16, and the final length is always zero or positive.
Frequently Asked Questions
1. What is a vector?
A vector is a quantity that has both size and direction, such as velocity or force. In this calculator it is written as three numbers, the x, y, and z components, which describe how far it extends along each axis.
2. What are vector components?
Components are the individual numbers that make up a vector. The x component measures reach along the x axis, y along the y axis, and z along the z axis. Together they describe the full vector.
3. How do you add two vectors?
Add matching components: the new x is ax + bx, the new y is ay + by, and the new z is az + bz. For example, (3, 4, 0) + (1, 2, 3) = (4, 6, 3).
4. How is subtraction different from addition?
Subtraction follows the same component pattern but subtracts instead of adds, and the order matters. A – B and B – A point in exactly opposite directions, so always check which vector you are subtracting from which.
5. What is the dot product?
The dot product multiplies matching components and adds the three products, giving one number. It measures how much two vectors point in the same direction and is used in work calculations, angles, and graphics lighting.
6. What does a dot product of zero mean?
It means the two vectors are perpendicular, at right angles to each other, provided neither vector is the zero vector. This is a quick test for perpendicularity in geometry, physics, and programming.
7. How do you find the magnitude of a vector?
Square each component, add the squares, and take the square root. For (3, 4, 0) that is the square root of 9 + 16 + 0, which is the square root of 25, giving a magnitude of 5.
8. Can a magnitude be negative?
No. Magnitude is a length, and lengths are always zero or positive. Because the formula squares every component before adding, the value inside the square root can never be negative.
9. Can I use negative components?
Yes. A negative component means that part of the vector points in the negative direction along that axis. Negative components are normal in real problems and the calculator handles them in every operation.
10. Can I use decimal components?
Yes. The calculator accepts decimals in every field, which is important for measured data such as velocities, forces, and positions that rarely come out as whole numbers.
11. Does this calculator work for two-dimensional vectors?
Yes. Enter 0 for both z components and every operation behaves exactly as it would for flat two-dimensional vectors, since the z terms contribute nothing to the results.
12. What is the zero vector?
The zero vector is (0, 0, 0). It has zero length and no direction. Adding it to any vector changes nothing, and its dot product with any vector is zero.
13. Why does the dot product give a number instead of a vector?
Because the dot product is designed to measure agreement between directions, which is a single quantity. A different operation, the cross product, is the one that produces a new vector from two vectors.
14. Where are vectors used outside mathematics class?
They are used in physics for forces and motion, in games and graphics for movement and lighting, in navigation for course corrections, and in engineering for stresses and flows, among many other fields.
15. What should I check if my answer looks wrong?
Check that each component sits in the correct box, that negative signs were entered, and that zero components were typed as 0 rather than left blank. Then compare the breakdown line with your own working step by step.
Final Thoughts
Vector arithmetic becomes easy once you trust the pattern: components combine only with their matches, the dot product collapses two vectors into one telling number, and magnitude is just the Pythagorean theorem in three dimensions. Use this calculator to check homework, prototype physics and graphics work, or simply build intuition by trying your own numbers. The breakdown under every answer means you are never just copying a result; you can see the reasoning, learn from it, and carry that understanding into the next problem.