Vector Calculator

Vector u

Vector v

The cross product gives a vector perpendicular to both u and v. Its working shows the three determinant minors, and the page checks the answer: the result must have dot product zero with both u and v.

Disclaimer: This calculator gives estimates for general information only. It is not financial, medical or other professional advice. Vector results are exact component arithmetic on the numbers you enter, shown to six significant figures.

What this calculator does

A vector is a quantity with a size and a direction: a push, a velocity, a displacement. This page does the full standard set of vector operations in two or three dimensions, and it shows the working for each one, not just the answer. Add and subtract vectors component by component, scale one by a number, take the dot product (a scalar that measures how much two vectors agree in direction) or the cross product (a new vector perpendicular to both, with the determinant working written out and the answer checked), find a magnitude and its unit vector, measure the angle between two vectors, project one vector onto another, or evaluate the scalar triple product, the signed volume of the box the three vectors span. Every vector result comes with a diagram; in 3D the diagram is the projection onto the x-y plane and is labelled as such.

How to use it

  • Pick the dimension first. 2D hides the third (z) components; switching back to 3D brings them back with the values still in place. In 2D the cross product is still available: it comes out along the z axis, and its size is the area of the parallelogram the two vectors span.
  • Magnitude and scalar multiply work on u alone, so the v fields hide for those two operations. The triple product needs a third vector w, whose fields appear when you choose it.
  • Read the working row. Each result shows its substitution (the actual numbers multiplied, subtracted and added), so a wrong answer can be traced to the component that produced it.
  • Zero vectors are refused where they break the maths. An angle needs two nonzero vectors, a projection needs a nonzero direction vector, and a unit vector needs a nonzero length; the page says which one is zero instead of printing nonsense.

The method

Components, addition and scaling

A vector is its components: u = (u₁, u₂, u₃). Addition and subtraction are done component by component, u ± v = (u₁ ± v₁, u₂ ± v₂, u₃ ± v₃), which is the head-to-tail rule written in numbers. Scaling multiplies every component, k·u = (k u₁, k u₂, k u₃): a positive k stretches or shrinks the vector, a negative k also turns it around.

The dot product and the angle

The dot product multiplies matching components and adds: u · v = u₁v₁ + u₂v₂ + u₃v₃. Its meaning is geometric: u · v = |u| |v| cos θ, where θ is the angle between the vectors, so the angle falls out of the same calculation as θ = cos⁻¹( (u · v) / (|u| |v|) ). A dot product of zero means the vectors are perpendicular; a negative one means they point more against each other than along each other. The magnitude itself is the square root of the vector dotted with itself, |u| = √(u · u), and the unit vector in u’s direction is û = u / |u|.

The cross product

The cross product is the determinant built from the two vectors: u × v = (u₂v₃ − u₃v₂, u₃v₁ − u₁v₃, u₁v₂ − u₂v₁). Note the middle component’s order: it is u₃v₁ − u₁v₃, the sign the determinant’s checkerboard gives it, and the most common slip in hand calculation. The result is perpendicular to both inputs, which is why this page verifies it: (u × v) · u and (u × v) · v must both be zero, and both checks are printed. Its length |u × v| = |u| |v| sin θ is the area of the parallelogram the two vectors span, and swapping the order reverses it: v × u = −(u × v). In 2D the same formula runs with third components of zero, leaving (0, 0, u₁v₂ − u₂v₁): a vector straight out of the plane whose signed size is that parallelogram area.

Projection and the triple product

The projection of u onto v is the shadow of u along v’s direction: proj = ((u · v) / (v · v)) v. Its length, the scalar projection (u · v) / |v|, is signed: negative when u points against v. What is left over, u − proj, is perpendicular to v, and the page prints it so the split can be checked: projection plus leftover rebuilds u exactly. The scalar triple product u · (v × w) is the 3×3 determinant of the three vectors; its absolute value is the volume of the parallelepiped they span, and its sign tells you whether the three vectors form a right-handed or a left-handed set. It is zero exactly when the three vectors lie in one plane.

Worked examples

Cross product (the loaded defaults). u = (1, 2, 3), v = (4, −5, 6). First component: (2)(6) − (3)(−5) = 12 + 15 = 27. Second: (3)(4) − (1)(6) = 6. Third: (1)(−5) − (2)(4) = −13. So u × v = (27, 6, −13), with length √934 ≈ 30.5614, and it checks: (27)(1) + (6)(2) + (−13)(3) = 0 and (27)(4) + (6)(−5) + (−13)(6) = 0.

Dot product and angle in 2D. u = (2, 3), v = (5, −1): u · v = (2)(5) + (3)(−1) = 7. Lengths: |u| = √13 ≈ 3.60555, |v| = √26 ≈ 5.09902. cos θ = 7 / (√13 √26) ≈ 0.380765, so θ ≈ 67.6199°, an acute angle: the vectors lean the same way, but only somewhat.

Projection. Projecting u = (1, 2, 3) onto v = (4, −5, 6): u · v = 12 and v · v = 77, so the projection is (12/77) v ≈ (0.623377, −0.779221, 0.935065), the scalar projection is 12 / √77 ≈ 1.36753, and the leftover (0.376623, 2.77922, 2.06494) is perpendicular to v.

Triple product. With w = (2, 0, 1) as well: v × w = (−5, 8, 10), and u · (v × w) = (1)(−5) + (2)(8) + (3)(10) = 41. The three vectors span a box of volume 41, and the positive sign says the set (u, v, w) is right-handed.

Reading your result

For a vector answer, read the components first and the length second: the components say where it points, the length says how big it is. A cross product should always be sanity-checked against the two printed zeros; if either check is not zero, a component was typed wrong. For the angle, the degrees figure is the smaller angle between the vectors (always between 0° and 180°); values near 0° mean nearly parallel, near 90° nearly perpendicular, near 180° nearly opposite. A negative scalar projection is not an error: it means u has a component pointing against v, and the projection vector itself points opposite to v. For the triple product only the size is a volume; the sign is orientation, not a mistake.

Limitations

  • Two and three dimensions only. The operations here are the geometric ones; vectors in four or more dimensions keep the dot product, magnitude, angle and projection but have no cross product of this kind.
  • The 3D diagram is a projection. A flat screen cannot draw a true 3D arrow honestly, so the diagram shows the x-y shadows of the vectors and says so; the table’s numbers are the exact result.
  • Angles come from a ratio. The angle is computed from cos θ = (u · v)/(|u||v|); for nearly parallel vectors the ratio sits near 1, where tiny rounding differences move the angle most, so a very small angle is the least precise figure on the page.
  • Components are decimals. Fractions and symbolic entries are not parsed; enter 0.333333 rather than 1/3, and read six-significant-figure output as rounded from exact component arithmetic.

Frequently asked questions

What is the difference between the dot product and the cross product?

The dot product answers with a number and measures agreement: how much of u lies along v, scaled by both lengths. The cross product answers with a vector and measures the opposite idea: it is perpendicular to both, with a length equal to the area the two vectors span. Parallel vectors have the largest dot product for their lengths and a cross product of zero; perpendicular vectors have a dot product of zero and the largest cross product for their lengths.

Why does the angle calculation refuse a zero vector?

Because the zero vector has no direction, so “the angle between it and something” is not a small or special angle, it is meaningless. The formula shows why: it divides by |u| |v|, and a zero length makes that a division by zero. The same applies to a unit vector (a direction with no length to divide by) and to projecting onto a zero direction.

Does the order matter in a cross product?

Yes, completely: v × u is the exact negative of u × v. The magnitude and the line of the answer are the same; the direction flips, following the right-hand rule: fingers along the first vector, curl toward the second, thumb gives the answer’s direction. Swapping the vectors turns the thumb the other way. Addition and the dot product do not care about order; subtraction and the cross product do.

What does a triple product of zero mean?

That the three vectors are coplanar: they lie in a single plane, so the box they would span is flat and has no volume. It happens if any one of them is a combination of the other two, which includes the obvious cases of a repeated vector, a zero vector, or two of them being parallel.

Related calculators

Method: component-wise addition, subtraction and scaling; dot product u · v = Σ uᵢvᵢ with the angle from cos θ = (u · v) / (|u| |v|); cross product as the formal determinant (u₂v₃ − u₃v₂, u₃v₁ − u₁v₃, u₁v₂ − u₂v₁), verified perpendicular to both inputs on every calculation; projection ((u · v)/(v · v)) v with the perpendicular remainder printed; scalar triple product as the 3×3 determinant. All fixtures verified against independently computed values. Last reviewed: 23 October 2026.