Vector Calculator

Magnitude of A—
Magnitude of B—
Dot product A·B—
Angle between A and B (°)—
Cross product magnitude |A×B|—

How Vector Calculator is calculated: |A| = √(x² + y² + z²), A·B = |A||B|cosθ

What is a vector, and what does this calculator do?

A vector is a quantity with a size and a direction: a force pushing north-east, a velocity of 20 m/s upwards, a displacement of 3 km east. It is written as a list of components — (3, 4, 0) means 3 units along x, 4 along y, and none along z. The components tell you everything about the vector, and every calculation in this tool starts from them.

This calculator takes two 3D vectors, A and B, and works out the five numbers people ask for most: the magnitude (length) of each vector, the dot product, the angle between them, and the magnitude of the cross product. Those five numbers answer most vector questions in physics, engineering, and computer graphics without any further work.

Enter the x, y, and z components of each vector and the results appear instantly. Leave z as zero for 2D problems — the formulas handle that naturally. The calculator is the quick check for homework, lab work, and any 3D problem where the arithmetic is long and the sign errors are easy.

How vector magnitude, dot product, and angle work

Magnitude is the length of the vector, found with Pythagoras extended to three dimensions: the square root of x² + y² + z². For the default vector A = (3, 4, 0), the magnitude is √(9 + 16 + 0) = 5. That 3-4-5 triangle is the most famous in mathematics, and it is no accident that it appears as the default — it makes the arithmetic easy to check by hand.

The dot product multiplies matching components and adds them: A·B = ax·bx + ay·by + az·bz. It is a single number, and it measures how much the two vectors point the same way. For the defaults, A·B = 3×1 + 4×2 + 0×2 = 11. A positive dot product means the angle between the vectors is less than 90 degrees; zero means they are perpendicular; negative means the angle is more than 90 degrees.

The angle comes from the dot product: cos θ = (A·B) ÷ (|A| × |B|). With |A| = 5, |B| = 3, and A·B = 11, cos θ = 11 ÷ 15 = 0.733, so θ is about 42.83 degrees. The cross product magnitude is |A| × |B| × sin θ, which is the area of the parallelogram the two vectors span — 10.20 for the defaults.

Components: the input people get wrong

The most common error is mixing up the order of the components — entering (y, x, z) instead of (x, y, z), or swapping the two vectors. The calculator labels each box, so enter A first, then B, and keep x, y, z in that order. A swapped component changes the dot product and the angle, and the mistake is invisible unless you check the magnitudes.

Signs are the second trap. A vector pointing down or backwards has negative components, and those minus signs matter: (−3, 4, 0) has the same magnitude as (3, 4, 0) but a different dot product with every other vector. Enter the signs as they are — the calculator handles them, and the angle will come out right.

Units are the third trap. Both vectors must be in the same units: metres with metres, newtons with newtons. A force in newtons dotted with a displacement in metres gives work in joules, which is a meaningful number; a force in newtons dotted with a velocity in m/s gives power in watts. Mixing units gives a number with no physical meaning.

A worked example: A = (3, 4, 0) and B = (1, 2, 2)

Take the defaults. Vector A = (3, 4, 0): magnitude √(9+16+0) = 5. Vector B = (1, 2, 2): magnitude √(1+4+4) = 3. Dot product = 3×1 + 4×2 + 0×2 = 3 + 8 + 0 = 11. The angle: cos θ = 11 ÷ (5×3) = 0.7333, so θ = 42.83 degrees. Cross product: A×B = (4×2 − 0×2, 0×1 − 3×2, 3×2 − 4×1) = (8, −6, 2), whose magnitude is √(64+36+4) = √104 = 10.20.

Try a perpendicular pair to see the dot product vanish: A = (1, 0, 0) and B = (0, 1, 0). Magnitudes are both 1, dot product is 0, angle is exactly 90 degrees, and the cross product magnitude is 1 — the unit square has area 1. That is the cleanest possible check that the calculator is doing what you think.

Try parallel vectors: A = (2, 0, 0) and B = (5, 0, 0). The angle is 0 degrees, the dot product is 10 (the product of the magnitudes), and the cross product is 0 — parallel vectors span no area at all. These edge cases are the fastest way to confirm you understand what each result means.

Who uses a vector calculator

Physics and engineering students use it the most. Vectors are the language of forces, velocities, electric fields, and moments, and every mechanics course in Class 11, JEE, NEET, and first-year university leans on them. The dot product gives work, the cross product gives torque, and the angle gives the direction of a force relative to a surface — three exam topics from one tool.

Computer graphics programmers use vectors constantly: lighting a 3D scene is a dot product between a surface normal and a light direction, and the angle between two vectors decides how bright a surface looks. Game developers use the same maths for movement, aiming, and collision. Robotics engineers use vectors for arm positions and for the torque at each joint.

Surveyors, navigators, and pilots work with vectors too — a displacement, a wind velocity, and a heading are all vectors, and adding them correctly is how a plane lands where it meant to. Even a simple question like the shortest distance from a point to a line is a cross product in disguise.

Vectors are quietly everywhere in modern life. A phone's GPS works out your position from satellite signals that are vectors in three dimensions. Weather maps show wind as arrows — direction plus speed, which is the very definition of a vector. A cricket analyst breaks a bowler's delivery into speed and swing components, and a structural engineer adds up the forces on every beam of a building as vectors before deciding whether it stands. The same five numbers this calculator produces sit underneath all of it.

Dot product vs cross product: which one do you need

The dot product gives a number; the cross product gives a vector. Use the dot product when the question is about alignment — work done by a force, the component of one vector along another, or the angle between two vectors. Use the cross product when the question is about rotation or area — torque, angular momentum, or the area of a parallelogram.

The two products behave differently with parallel and perpendicular vectors, and that is a useful memory aid. Parallel vectors have the biggest possible dot product and a zero cross product. Perpendicular vectors have a zero dot product and the biggest possible cross product. If you know which one is zero, you know whether the vectors are parallel or perpendicular.

For matrix work that often sits beside vector work, the matrix calculator handles the matrix side, and the determinant calculator gives the determinant, which is the cross product's close cousin in two dimensions. Together the three tools cover most of linear algebra's routine arithmetic.

Common mistakes with vector calculations

The biggest mistake is forgetting that the dot product is a number and the cross product is a vector. Adding them together, or comparing them directly, is meaningless — they are different kinds of object. This calculator shows the cross product's magnitude, not the vector itself, so remember that the direction (given by the right-hand rule) is missing from the display.

Second: the angle formula needs the magnitudes in the denominator. Forgetting to divide by |A| × |B| gives a cosine bigger than 1, which no calculator will accept — and if your calculator returns an error for arccos, that missing division is the first thing to check. Third: using degrees where radians are expected, or the reverse, in hand calculations. This calculator shows the angle in degrees, which is what most people want.

Fourth: the cross product order matters. A×B points the opposite way to B×A, and the components change sign. The magnitude is the same either way, so this calculator cannot catch an order swap — but if you are working out the vector itself by hand, keep A first and B second, and use the right-hand rule to check the direction.

How to use this vector calculator

Enter the x, y, and z components of vector A, then the same for vector B. For a 2D problem, leave both z boxes at zero. The five results update instantly: both magnitudes, the dot product, the angle in degrees, and the cross product magnitude. The angle is always shown in degrees, never radians.

Sanity-check your results with the edge cases: a dot product of zero means perpendicular, a cross product of zero means parallel, and the angle should always sit between 0 and 180 degrees. If the angle comes out as 0 or 180, your vectors are parallel — check whether that is what you intended.

Everything runs in your browser with no sign-up and nothing uploaded. For the distance between two points, the distance calculator covers the straight-line case, and for the matrix side of the same course the matrix calculator is the companion page.

Frequently Asked Questions

Use cos θ = (A·B) ÷ (|A| × |B|), where A·B is the dot product and |A|, |B| are the magnitudes. For A = (3,4,0) and B = (1,2,2), the dot product is 11 and the magnitudes are 5 and 3, so cos θ = 11 ÷ 15 = 0.733 and θ is about 42.83 degrees.

The dot product measures how much two vectors point the same way. In physics it gives the work done by a force (force · displacement), the component of one vector along another, and the angle between vectors. A dot product of zero means the vectors are perpendicular.

The cross product gives a vector perpendicular to both inputs, with a magnitude equal to the area of the parallelogram they span. In physics it gives torque (position × force) and angular momentum. Its direction follows the right-hand rule, and swapping the inputs flips the direction.

Take the square root of the sum of the squared components: |A| = √(x² + y² + z²). For (3, 4, 0) that is √(9 + 16) = 5. For a 2D vector, leave z as zero and the same formula gives the length from Pythagoras' theorem.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.