What this calculator does
Do the everyday vector jobs in one place: find a vector's length, add or subtract two vectors, or find the angle between them. A vector is an arrow with both a size and a direction. You write it as a list of components, the amounts it moves along each axis. That's (x, y) in two dimensions (2D) or (x, y, z) in three (3D).
Vectors describe moves from one place to another, speeds with a direction, forces, and directions in computer graphics. A handful of operations cover most of what people do with them.
Choose 2D or 3D, pick an operation, and enter the components of vector A. Add vector B where it's needed. The calculator gives the magnitude (length), the unit vector, the sum or difference, the dot product, the angle between the two vectors, or the cross product. It shows the arithmetic one component at a time.
Where it's used
Why this math matters outside the classroom:
- Flight paths. A plane flying 200 km/h north in a 50 km/h east wind moves at √(200² + 50²), about 206 km/h, over the ground.
- Physics work. A 10 N force at 60° to a 5 m path does 10 × 5 × cos 60° = 25 J of work, a dot product.
- Game movement. Game developers normalize a direction vector (3, 4) to (0.6, 0.8) so characters move at the same speed in any direction.
- Wrench torque. A 20 N force applied at right angles to a 0.3 m wrench produces a torque of 6 N·m, the size of a cross product.
- Cable forces. Engineers add the force vectors of two cables holding a sign to check that their sum balances the sign's weight.
Grade level and standards: Grade 11 to college; Common Core State Standards for Mathematics HSN.VM.B.4. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Select 2D or 3D. In 2D, the z-components are hidden and treated as zero.
- Select the operation. Magnitude and unit vector use vector A only; the others use both A and B.
- Enter the components. Negative and decimal values are fine.
- Read the result. Vector answers are shown as a component list such as (13, -7, -5). Each component and the result's length are also listed separately.
What the inputs mean
- Operation
- The cross product works for 3D vectors. If you choose it in 2D, the vectors are treated as lying flat on the xy-plane, and the result points straight along the z-axis.
- A: x
- The x-component of vector A: how far it reaches along the x-axis. For a vector from point P to point Q, subtract P's coordinates from Q's.
Formula and method
|A| = √(a_x² + a_y² + a_z²) Â = A ÷ |A| A ± B = (a_x ± b_x, a_y ± b_y, a_z ± b_z) A · B = a_x b_x + a_y b_y + a_z b_z cos θ = (A · B) ÷ (|A| × |B|) A × B = (a_y b_z − a_z b_y, a_z b_x − a_x b_z, a_x b_y − a_y b_x)
Here a_x, a_y and a_z are the parts of A along each axis. b_x, b_y and b_z are the same for B. |A| is the magnitude, or length, of A. Â (A with a hat) is its unit vector. A · B is the dot product, A × B is the cross product and θ is the angle between the vectors.
The magnitude is the Pythagorean theorem applied to the components. Dividing a vector by its magnitude gives the unit vector: the same direction, with a length of exactly 1. Sums and differences work one component at a time.
The dot product is a single number. It equals |A| × |B| × cos θ. So it's positive when the vectors point roughly the same way, and zero when they're at right angles. It's negative when they point roughly apart. Rearranging it gives the angle between them, from 0° to 180°.
For vectors that point almost the same way, the calculator finds that angle with an arctangent formula that gives the same result. It avoids losing accuracy to rounding.
The cross product of two 3D vectors is a new vector at right angles to both. It follows the right-hand rule: curl the fingers of your right hand from A towards B, and your thumb points along A × B. Its length equals the area of the parallelogram (slanted rectangle) the two vectors make. Half that is the area of the triangle they form.
Worked example
Two 3D vectors are A = (3, 4, 0) and B = (4, 0, 3). What angle lies between them?
- Dot product: 3 × 4 + 4 × 0 + 0 × 3 = 12.
- Magnitudes: |A| = √(3² + 4² + 0²) = 5 and |B| = √(4² + 0² + 3²) = 5.
- cos θ = 12 ÷ (5 × 5) = 0.48.
- θ = arccos(0.48) ≈ 61.3146°.
Result: The vectors are about 61.3146° apart. With the default vectors A = (2, 3, 1) and B = (1, -1, 4), the cross product is (13, -7, -5), with length √243 ≈ 15.5885.
Understanding the result
A dot product of zero means the vectors are at right angles (perpendicular, or orthogonal). A cross product of (0, 0, 0) means they're parallel, or one of them is zero.
The order matters for subtraction and the cross product: A − B = −(B − A) and B × A = −(A × B). Addition and the dot product give the same answer either way.
Units carry through. Multiplying two force vectors in newtons gives a dot product in square newtons. So give all the components matching units.
Assumptions and limitations
- Components are measured along x, y and z axes at right angles to each other (a standard Cartesian system).
- The cross product follows the right-hand rule.
- Vectors with more than three components, scalar multiples (stretching a vector by a number) and projections aren't offered as separate operations.
- The unit vector and the angle don't exist for the zero vector, which has no direction. So the calculator shows an error.
- Vector results are shown rounded to six decimal places. The individual components are listed at your chosen precision.
Frequently asked questions
What does the dot product tell me?
It measures how much two vectors point the same way. Divide it by both lengths and you get the cosine of the angle between them. In physics, the work done by a force is the dot product of the force and the distance moved.
Why is the cross product only defined in 3D?
In three dimensions, there's exactly one direction at right angles to two vectors that aren't parallel. So the cross product can be a vector. In 2D, no such direction exists inside the flat plane. That's why the calculator lifts 2D vectors into 3D and gives a result along the z-axis. Its z-component, a_x b_y − a_y b_x, is often called the 2D cross product.
How do I find the vector between two points?
Subtract the start point's coordinates from the end point's. From P = (1, 2, 3) to Q = (4, 6, 3), the vector is (3, 4, 0). Its magnitude, 5, is the distance between the points.
What is a unit vector used for?
It holds a direction without any size. Multiply a unit vector by a length to get a vector of that length in that direction. That's common in physics, navigation and computer graphics.
How this calculator is checked
Method: Standard Euclidean vector definitions: component-wise sum and difference, Euclidean norm, dot product, cross product (right-hand rule) and angle via the dot product. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Vector Calculator on your own website or blog for free. Paste this code where you want it to appear: