Dot product calculator
A dot product calculator multiplies two vectors to give a single number: multiply the matching components and add them. For a = (a₁, a₂) and b = (b₁, b₂), a · b = a₁b₁ + a₂b₂. Our Vector Calculator gives the dot product in 2D and 3D, and the angle between the vectors, which is what the dot product is mostly used for.
Choose Two Vectors mode for 2D, or 3D mode for vectors with a z component. It opens in Single mode, which has only one vector, so switching mode is the first step. The dot product is also called the scalar product.
Vectors Calculator
Visualise magnitude, direction and operations
How to use the dot product calculator
- Under Mode, choose Two Vectors for 2D or 3D.
- In Vectors, type the components of a and b, or drag the arrows on the grid.
- Read the dot product, a · b, and the angle θ between the vectors in Results.
- Open Formulas to see the dot product and the angle formula with your numbers in.
Angles are in degrees unless you switch Degrees off under Display. 3D mode also gives each vector's magnitude and the cross product.
The dot product formula
In components, add the products of matching components:
Geometrically, the dot product is the product of the lengths and the cosine of the angle between them, which rearranges to give the angle:
Worked examples you can check in the calculator
Example 1: dot product and angle in 2D
Find a · b and the angle between a = (4, 1) and b = (2, 5).
The magnitudes are |a| = √17 and |b| = √29, so cos θ = 13 ÷ √(17 × 29) = 0.5855 and θ = 54.16°. In Two Vectors mode, type both vectors: Results shows a · b = 13 and θ = 54.16°.
Example 2: perpendicular vectors
For a = (3, −2) and b = (4, 6), a · b = 12 − 12 = 0. A dot product of 0 means the vectors are perpendicular, and the calculator shows θ = 90°. This is the quickest test for right angles between vectors.
Example 3: an obtuse angle
For a = (1, 2) and b = (−3, −1), a · b = −3 − 2 = −5. A negative dot product means the angle is obtuse, more than 90°: here it is 135°.
Example 4: 3D vectors
Find the angle between a = (2, −1, 3) and b = (4, 2, 1).
|a| = √14 and |b| = √21, so cos θ = 9 ÷ √294 = 0.5249 and θ = 58.34°. In 3D mode the calculator shows a · b = 9 and θ = 58.34°.
Check you have the formula:
What the sign of the dot product tells you
| Dot product | Angle between the vectors |
|---|---|
| Positive | Acute, less than 90° |
| Zero | Exactly 90°: perpendicular |
| Negative | Obtuse, more than 90° |
Where the dot product is used
- Work done in physics: W = F · d. A force of (3, 4) N moving an object (5, 0) m does 3 × 5 + 4 × 0 = 15 J of work.
- Projection: the length of a in the direction of b is a · b ÷ |b|. For Example 1 that is 13 ÷ √29 = 2.41.
- Checking perpendicular lines and planes in geometry and mechanics.
For a vector at right angles to both a and b, use the cross product instead: see our cross product calculator guide. The vector calculator guide covers the rest of the tool.
Common mistakes
- Writing the answer as a vector. The dot product is a scalar, a single number.
- Multiplying the wrong components. Multiply x with x, y with y and z with z, then add.
- Dropping negative signs. (−3) × 4 is −12. Use brackets.
- Forgetting to divide by the magnitudes. cos θ = a · b ÷ (|a||b|), not just a · b.
- Calculator in radians. cos⁻¹ gives radians unless your calculator is in degree mode.
Practise vectors in a short timed paper
Dot products come up in College Linear Algebra and AP Physics C: Mechanics practice, and in A-level Maths: Mechanics and A-level Further Maths in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics.
Common questions
How do you calculate the dot product?
How do you find the angle between two vectors?
What does a dot product of zero mean?
Is the dot product the same as the scalar product?
What is the difference between the dot product and the cross product?
Can the dot product be negative?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Vectors Calculator
Visualise magnitude, direction and operations
Open the tool - Test it
College Linear Algebra
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper - Test it
AP Physics C: Mechanics
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper