Vector Calculator (Dot Product, Cross Product and Angle)
Calculate the magnitude, unit vector, sum, difference, dot product, cross product, angle and projection of two 2D or 3D vectors.
How to use this calculator
Enter two vectors with two or three components each, such as 3, 4 or 1, -2, 5. Both must have the same number of components. The calculator gives each vector's magnitude and unit vector, A + B, A − B, the dot product, the cross product (3D, or the scalar z-component for 2D), the angle between them and the projection of A onto B.
Formula
|A| = √(Σaᵢ²). A · B = Σaᵢbᵢ. A × B = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). Angle θ = arccos(A · B ÷ (|A||B|)). Projection of A onto B = (A · B ÷ |B|²) B.
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Expert reviewIfrahMSc Mathematics
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
What does the dot product tell me?
It measures how much two vectors point in the same direction. It is positive for angles under 90°, zero for perpendicular vectors and negative for angles over 90°.
What is the cross product?
For 3D vectors, the cross product is a vector perpendicular to both, with length equal to the area of the parallelogram they form.
How do I find the angle between two vectors?
Divide the dot product by the product of the magnitudes and take the inverse cosine.
What is a unit vector?
A vector of length 1 pointing in the same direction, found by dividing a vector by its magnitude.
Can I use 2D vectors?
Yes. For 2D vectors the cross product is reported as the single number a₁b₂ − a₂b₁, the z-component.
Where are vectors used?
In physics (forces, velocity), computer graphics, navigation and machine learning, where the dot product measures similarity.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- Strang, G. (2016). Introduction to linear algebra (5th ed.). Wellesley-Cambridge Press. View source
- Abramson, J. (2021). Precalculus 2e. OpenStax. View source
- Ling, S. J., Moebs, W., & Sanny, J. (2016). University physics volume 1. OpenStax. View source
- Olver, F. W. J., Lozier, D. W., Boisvert, R. F., & Clark, C. W. (Eds.). (2024). NIST Digital Library of Mathematical Functions. National Institute of Standards and Technology. View source