Skip to content
TheCalcUniverse

Vector Calculator — Add, Subtract, Dot & Cross Products

Compute vector operations including addition, subtraction, dot product, cross product, magnitudes, and the angle between vectors in 2D or 3D.

✓ Tested formula & cited sources Formula verified 2026-01-15 Runs in your browser — inputs never sent anywhere

See it worked out

Example — v₁x 2, v₁y 3, v₁z 0, v₂x 5:

Sum (v₁ + v₂)

(7, 9, 0)

Difference (v₁ − v₂)

(-3, -3, 0)

|v₁|

3.605551

|v₂|

7.81025

Dot Product (v₁·v₂)

28

Cross Product (v₁ × v₂)

(0, 0, -3)

Angle Between

6.115504°

The formula

a · b = |a||b|cos θ | a × b = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁)

v₁ = (x₁, y₁, z₁)
First Vector
v₂ = (x₂, y₂, z₂)
Second Vector
|v|
Magnitude (Length)
a · b
Dot Product
a × b
Cross Product

Worked example — v₁x 2, v₁y 3, v₁z 0, v₂x 5

Sum (v₁ + v₂) = (7, 9, 0)

Full explanation ↓

How Vector Calc Works

a · b = |a||b|cos θ | a × b = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁)

Vector operations are fundamental in physics, engineering, and computer graphics. The vector sum is computed component-wise, while the dot product yields a scalar representing the projection of one vector onto another. The cross product produces a third vector perpendicular to both inputs. The angle between vectors is derived from the dot product formula: cos θ = (a·b)/(|a||b|).

v₁ = (x₁, y₁, z₁)
First VectorThe first input vector defined by its three spatial components.
v₂ = (x₂, y₂, z₂)
Second VectorThe second input vector defined by its three spatial components.
|v|
Magnitude (Length)The length of a vector, calculated as √(x² + y² + z²). Always non-negative.
a · b
Dot ProductThe scalar product: a₁b₁ + a₂b₂ + a₃b₃. Measures alignment between vectors.
a × b
Cross ProductThe vector product: a 3D vector perpendicular to both a and b. Magnitude equals area of parallelogram.
Vectors can be added, subtracted, and multiplied using dot and cross products

How to Use

  1. Enter the x, y, and z components of both vectors. For 2D vectors, leave the z components as 0.
  2. The calculator computes addition, subtraction, magnitudes, dot product, cross product, and the angle between vectors.
  3. Review the results: addition and subtraction show component-wise results; the angle shows how aligned the vectors are.
  4. Vectors with z = 0 are treated as 2D vectors, but cross product results will still be displayed in 3D format.

Quick Reference

Additionv₁ + v₂ = (x₁+x₂, y₁+y₂, z₁+z₂)
Dot producta · b = |a||b|cos θ
Cross product|a × b| = |a||b|sin θ
Angleθ = arccos((a·b)/(|a||b|))

Common Uses

  • Physics: calculating net force by adding force vectors, computing work as the dot product of force and displacement.
  • Computer graphics: representing positions, directions, velocities, and normals; performing lighting calculations using dot products.
  • Engineering: analyzing structural forces, moments (torque uses cross product), and fluid velocity fields.
  • Machine learning: representing feature vectors and computing similarity using dot products in high-dimensional spaces.
  • Robotics: describing robot arm positions and orientations, computing transformations between coordinate frames.

Understanding the Result

Vectors are mathematical objects with both magnitude and direction, represented as ordered tuples of numbers. In 2D, a vector has two components (x, y); in 3D, three components (x, y, z). Vector addition is performed component-wise and geometrically follows the parallelogram law. The dot product (or scalar product) produces a scalar from two vectors and is zero when the vectors are perpendicular — making it invaluable for testing orthogonality. The cross product exists only in 3D and produces a vector perpendicular to both inputs, with magnitude equal to the area of the parallelogram they span. The right-hand rule determines the direction of the cross product. The angle between vectors is derived from the dot product formula, and the angle is 0° for parallel vectors, 90° for perpendicular vectors, and 180° for anti-parallel vectors. Vector operations are the mathematical foundation for describing physical quantities like force, velocity, acceleration, and electromagnetic fields.

Frequently Asked Questions

What is the difference between the dot product and the cross product?
The dot product produces a scalar (a single number) and measures how much two vectors point in the same direction. It is commutative: a·b = b·a. The cross product produces a vector perpendicular to both inputs and measures how much two vectors point in different directions. It is anti-commutative: a × b = −(b × a). The cross product only exists in 3D, while the dot product works in any dimension.
Can I use this calculator for 2D vectors?
Yes! Simply leave the z-components as 0 (the default). The calculator will display 2D results for addition and subtraction, though the cross product is inherently a 3D operation. For 2D vectors, the cross product magnitude equals |v₁x·v₂y − v₁y·v₂x|, which represents the signed area of the parallelogram.
What does a dot product of zero mean?
A dot product of zero means the vectors are orthogonal (perpendicular) to each other. This is a critically important property in geometry, physics, and linear algebra. For example, in 3D graphics, surface normals are perpendicular to surfaces, so lighting calculations use zero dot products to detect surfaces facing away from the light source.
How is the angle between vectors calculated?
The angle is calculated using the dot product formula: cos θ = (a·b)/(|a||b|). Rearranging: θ = arccos((a·b)/(|a||b|)). The result is in the range [0°, 180°], where 0° means the vectors point in exactly the same direction, 90° means they are perpendicular, and 180° means they point in exactly opposite directions.
What is the geometric meaning of the cross product magnitude?
The magnitude of the cross product |a × b| equals the area of the parallelogram formed by the two vectors. It is also equal to |a||b|sin θ, where θ is the angle between the vectors. This means the cross product magnitude is maximized when the vectors are perpendicular (sin 90° = 1) and zero when they are parallel (sin 0° = 0).
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "Vector Calculator — Add, Subtract, Dot & Cross Products." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/vector-calculator/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator