➡️ Vector Calculator
Perform vector addition, subtraction, dot product, cross product, magnitude and angle calculation in 2D or 3D, with a visual parallelogram diagram.
In 2D mode, the third component is treated as zero.
What is this tool?
A vector is a mathematical object that has both magnitude (length) and direction. Unlike plain numbers, which only have size, vectors carry information about where they point — making them essential in physics for describing velocity, force and acceleration, and in computer graphics for positions and directions.
This calculator handles the core vector operations in both 2D and 3D. You enter the components of two vectors, and it computes the sum, difference, dot product, cross product (3D only), magnitude of each vector, and the angle between them. Each result is derived from a single click, with a visual diagram showing how the vectors combine.
The tool also reports derived quantities that physics students commonly need: the unit vector in each direction, the projection of one vector onto another, and the cosine of the angle (which is the dot product divided by the product of magnitudes). Everything runs locally in your browser — no upload, no account, instant results.
For related calculations, try the matrix calculator, the Pythagorean theorem calculator and the trigonometry calculator to explore more useful tools.
How it works
Vector operations follow component-wise rules. For two vectors a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), addition is (a₁+b₁, a₂+b₂, a₃+b₃) and subtraction is (a₁−b₁, a₂−b₂, a₃−b₃). The dot product is a₁b₁ + a₂b₂ + a₃b₃, a scalar that measures how much two vectors point in the same direction. The cross product (3D only) is (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁), a vector perpendicular to both inputs.
The magnitude of a vector is the square root of the sum of its squared components: |a| = √(a₁² + a₂² + a₃²). The angle θ between two vectors comes from the relationship cos θ = (a·b) ÷ (|a||b|), which rearranges to θ = arccos((a·b) ÷ (|a||b|)).
Derived metrics include the unit vector (each component divided by the magnitude) and the scalar projection of a onto b (the dot product divided by |b|), which tells you how far a extends in b's direction. These are the values most often needed in physics homework and engineering calculations, so the tool computes them automatically.Vector Addition Diagram
Head-to-tail addition: the sum a + b is the diagonal of the parallelogram.
Vector Operations Formula Reference
Core formulas used by this calculator, for vectors a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃).
| Operation | Formula | Result type |
|---|---|---|
| Addition | a + b = (a₁+b₁, a₂+b₂, a₃+b₃) | Vector |
| Subtraction | a − b = (a₁−b₁, a₂−b₂, a₃−b₃) | Vector |
| Dot product | a · b = a₁b₁ + a₂b₂ + a₃b₃ | Scalar |
| Cross product | a × b = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁) | Vector (3D) |
| Magnitude | |a| = √(a₁² + a₂² + a₃²) | Scalar |
| Angle | θ = arccos((a·b) ÷ (|a||b|)) | Degrees |
Common Physical Vector Quantities
Everyday physical quantities that are represented as vectors.
| Quantity | Type | Typical unit |
|---|---|---|
| Displacement | Vector | metres (m) |
| Velocity | Vector | m/s |
| Acceleration | Vector | m/s² |
| Force | Vector | newtons (N) |
| Momentum | Vector | kg·m/s |
| Speed | Scalar | m/s |
| Energy | Scalar | joules (J) |
| Mass | Scalar | kg |
How to use
- Choose 2D or 3D mode.
- Enter the components of vector a.
- Enter the components of vector b.
- Press Calculate to see all results at once.
- Read the sum, difference, dot product, cross product, magnitudes and angle.
Frequently Asked Questions
What is the difference between a dot product and a cross product?
The dot product takes two vectors and returns a scalar (a single number) measuring how aligned they are. The cross product takes two 3D vectors and returns another vector that is perpendicular to both. They are different operations with different geometric meanings.
Why is the cross product only available in 3D?
The cross product is defined only for three-dimensional vectors. In 2D there is no third dimension for the result to point along, so the operation does not apply. For 2D problems, use the dot product and the angle instead.
What does a zero dot product mean?
A dot product of zero means the two vectors are perpendicular (at 90° to each other). This is the fastest way to check perpendicularity without computing any angles.
How is the angle between two vectors calculated?
Using the formula cos θ = (a·b) ÷ (|a||b|), so θ = arccos of that ratio. The tool computes both the cosine and the angle in degrees for convenience.
What is a unit vector?
A unit vector has a magnitude of exactly 1 and points in the same direction as the original vector. It is obtained by dividing each component by the vector's magnitude. Unit vectors are used to describe direction independently of length.
Can I use negative components?
Yes. Negative components are perfectly valid and simply mean the vector points in the opposite direction along that axis. The tool handles them in every operation.
Tips & Advice
For 2D problems, set the third component to zero — the tool still handles the calculation correctly. Remember that the dot product is a scalar and the cross product is a vector; they answer different questions. If the angle between two vectors comes out as 0°, they point in the same direction; 180° means opposite directions; 90° means they are perpendicular. A zero dot product is a fast test for perpendicularity — no angle calculation needed. When working with forces in physics, always keep the same unit for all components. The projection value is the answer to 'how much of a points along b', which is different from 'how much of b points along a' — check which direction the problem asks for.
Related Tools
Matrix Calculator
Perform matrix operations: addition, subtraction, multiplication and determinant
Pythagorean Theorem Calculator
Use the Pythagorean theorem to find the hypotenuse or any leg of a right triangl
Trigonometry Calculator
Calculate sine, cosine, tangent, cosecant, secant and cotangent for any angle. D
Slope Calculator
Calculate the slope between two points instantly. Enter x and y coordinates to g
Statistics Calculator
Free online statistics calculator. Compute mean, median, mode, range, variance,
Triangle Calculator
Calculate triangle area, perimeter, angles, and missing sides instantly. Enter a
Sources & References
- Wolfram MathWorld. Vector Addition. mathworld.wolfram.com.
- Khan Academy. Vectors and Spaces. khanacademy.org.
Last reviewed: August 2026.
Limitations
This tool performs standard vector arithmetic for educational and engineering purposes. Results are rounded to six decimal places.
What this tool does not account for:
- Floating-point precision: very large or very small components may show minor rounding artifacts.
- Units: the tool works with pure numbers; you must ensure all components use the same unit before entering them.
- Higher dimensions: only 2D and 3D vectors are supported; 4D and above are outside the scope.
Verify critical results with an independent calculation when precision matters.