Skip to content
CalculatorAtlas

Vector Calculator

Tested

Sum, difference, dot product, cross product and angle of two vectors.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The vector calculator adds, subtracts and multiplies vectors. For a = (1, 2, 3) and b = (4, 5, 6): a + b = (5, 7, 9), a − b = (−3, −3, −3), a · b = 32, a × b = (−3, 6, −3) and |a| = 3.7417.

Enter two vectors with 2 or 3 components. The calculator returns sum, difference, dot and cross products, magnitudes and the angle.

Related tools: Vector Magnitude Calculator: Length (Euclidean norm) of a vector. Vector Projection Calculator: Projection of vector a onto vector b. Unit Vector Calculator: Unit vector in the direction of a vector.

How to use the Vector Calculator

  1. Type vector a (2 or 3 components), for example 1, 2, 3.
  2. Type vector b (2 or 3 components), for example 4, 5, 6.
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the Vector Calculator
InputWhat to enterAllowed values
Vector a (2 or 3 components)Text, such as 1, 2, 3—
Vector b (2 or 3 components)Text, such as 4, 5, 6—

Formula and method

Formula

a + b; a − b; a·b = Σ aᵢbᵢ; a × b; θ = arccos(a·b ÷ |a||b|)

IEEE-754 double precision; shown to at most 6 decimal places.

Two-component vectors are treated as lying in the xy-plane.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Vector a (2 or 3 components) = 1, 2, 3; Vector b (2 or 3 components) = 4, 5, 6.

Results of example 1
ResultValue
Sum (a + b)(5, 7, 9)
Difference (a − b)(-3, -3, -3)
Dot product32
Cross product(-3, 6, -3)
Magnitude of a3.741657
Magnitude of b8.774964
Angle between12.9332°

Example 2

Inputs: Vector a (2 or 3 components) = 3, 4; Vector b (2 or 3 components) = -4, 3.

Results of example 2
ResultValue
Sum (a + b)(-1, 7, 0)
Difference (a − b)(7, 1, 0)
Dot product0
Cross product(0, 0, 25)
Magnitude of a5
Magnitude of b5
Angle between90°

Example 3

Inputs: Vector a (2 or 3 components) = 1, 0, 0; Vector b (2 or 3 components) = 0, 1, 0.

Results of example 3
ResultValue
Sum (a + b)(1, 1, 0)
Difference (a − b)(1, -1, 0)
Dot product0
Cross product(0, 0, 1)
Magnitude of a1
Magnitude of b1
Angle between90°

The first line is the headline result (sum (a + b)). Below it the vector Calculator lists difference (a − b), dot product, cross product, magnitude of a, magnitude of b and angle between, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

All operations at once

Sum and difference work component by component. The dot product is 4 + 10 + 18 = 32. The cross product exists only for 3D vectors. The angle between them is arccos(32 ÷ (3.7417 × 8.775)) = 12.93°.

Single-purpose pages

For one operation at a time, see the Dot Product, Cross Product, Vector Magnitude, Vector Projection, Vector Subtraction and Angle Between Two Vectors calculators. The angle needs non-zero vectors.

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Vector a (2 or 3 components): entering "1" shows "Enter 2 or 3 components." beside that field and no result.

Choosing between the Vector Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Vector Calculator and similar calculators
CalculatorYou enterIt returns
[Vector Magnitude Calculator](/math/vector-magnitude/)componentsMagnitude
[Vector Projection Calculator](/math/vector-projection-calculator/)vector A and vector BProjection
[Unit Vector Calculator](/math/unit-vector-calculator/)vectorUnit vector
[Vector Subtraction Calculator](/math/vector-subtraction-calculator/)vector A and vector Ba − b
[Fraction Calculator](/math/fraction-calculator/)numerator 1, denominator 1 and operationResult

Background: calculus, vectors and matrices

A derivative measures how fast a function's output changes with its input, and an integral accumulates a quantity such as area. The determinant of a 2×2 matrix [[a, b], [c, d]] is ad − bc, so [[3, 8], [4, 6]] has determinant 3×6 − 8×4 = −14.

The dot product of two vectors is the sum of the products of matching components and is a single number; a positive value means the vectors point in broadly the same direction.

Assumptions and limitations

  • Angle needs non-zero vectors

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for vector a (2 or 3 components) to confirm this.

Frequently asked questions

What is a vector?

A quantity with magnitude and direction.

Can I use 2D vectors?

Yes, with two components.

What is the difference between dot and cross products?

The dot gives a number, the cross a vector.

What does the Vector Calculator calculate?

Sum, difference, dot product, cross product and angle of two vectors. It returns Sum (a + b), Difference (a − b), Dot product, Cross product and Magnitude of a.

What formula does the Vector Calculator use?

a + b; a − b; a·b = Σ aᵢbᵢ; a × b; θ = arccos(a·b ÷ |a||b|). Two-component vectors are treated as lying in the xy-plane.

What do I need to enter in the vector Calculator?

You enter Vector a (2 or 3 components) and Vector b (2 or 3 components).

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Angle needs non-zero vectors.

What is an example of a vector result?

With vector a (2 or 3 components) 1, 2, 3 and vector b (2 or 3 components) 4, 5, 6, the sum (a + b) is (5, 7, 9).

Sources

  • OpenStax, Precalculus 2e (Rice University): vectors, polar coordinates and trigonometry

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.