Dot Product Calculator
Calculate the dot product of two 2D vectors, along with their magnitudes and the angle between them, with a visual diagram and full step-by-step working.
Vector A
Vector B
Dot Product A · B
7
|A| = 5 |B| = 5.385
Angle between vectors θ = 74.932°
The dot product is positive — the angle between the vectors is acute (less than 90°).
Vectors and the Angle Between Them
Both vectors are drawn from the same origin. The arc shows the angle θ derived from the dot product formula.
A · B = 7 | |A| = 5, |B| = 5.385 | θ = 74.932°
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
- 1
Write down each vector's x and y components
A = (3, 4), B = (5, -2)
The dot product combines two vectors of the same dimension into a single number (a scalar), computed by multiplying matching components and adding the results.
- 2
Multiply the matching x-components and y-components
Ax × Bx = 3 × 5 = 15, Ay × By = 4 × -2 = -8
Multiply x with x and y with y — never x with y. Each product is added together in the next step.
- 3
Add the products to get the dot product
A · B = 15 + -8 = 7
Summing the two component products gives the scalar dot product of A and B.
- 4
Find the magnitude of each vector
|A| = √(3² + 4²) = 5, |B| = √(5² + -2²) = 5.385
Each vector's magnitude (length) comes from the Pythagorean theorem applied to its own components.
- 5
Use the dot product formula to find the angle between the vectors
cos θ = (A · B) / (|A| |B|) = 7 / (5 × 5.385) = 0.26 → θ = 74.932°
Rearranging the dot product formula A · B = |A| |B| cos(θ) and solving for θ gives the angle between the two vectors.
✓ A · B = 7, |A| = 5, |B| = 5.385, θ = 74.932°
Free Online Dot Product Calculator
This dot product calculator instantly calculates the scalar dot product of two 2D vectors, along with each vector's magnitude and the angle between them. It works as a dot product calculator, vector dot product calculator, scalar product calculator, and angle between two vectors calculator all in one tool, so you never need to work through the multiplication, addition, and inverse cosine steps by hand.
Whether you're a student solving physics or linear algebra homework on work, projection, or vector angles, an engineer analyzing forces acting at different angles, or a game or graphics developer checking whether two directions are aligned or perpendicular, this dot product calculator gives you an instant, accurate result along with a visual diagram and complete step-by-step working, so the geometry behind the formula is never a mystery.
How to Use This Dot Product Calculator
Using this online dot product calculator takes only a few seconds. Enter the x and y components of vector A, then enter the x and y components of vector B — the dot product, both magnitudes, and the angle between the vectors update instantly as you type. The diagram redraws automatically to show both vectors from the same origin, with the angle between them marked and labeled.
- Enter the x-component and y-component of vector A
- Enter the x-component and y-component of vector B
- Read the dot product, magnitudes, and the angle between the vectors
- Check the diagram and step-by-step solution to see exactly how the answer was reached
Dot Product Formula
The dot product (also called the scalar product) of two vectors combines their matching components into a single number. For 2D vectors A = (Ax, Ay) and B = (Bx, By), the dot product is found by multiplying the x-components together, multiplying the y-components together, and adding the two results. Any equation you enter follows the same formula — just type both vectors' components, and the calculator solves it automatically.
- Component formula: A · B = Ax × Bx + Ay × By
- Geometric formula: A · B = |A| × |B| × cos(θ)
- Magnitude formula: |A| = √(Ax² + Ay²), and the same for |B|
- Angle formula (rearranged): θ = arccos( (A · B) / (|A| |B|) )
Worked Example: Finding the Dot Product and Angle
Suppose A = (3, 4) and B = (5, −2). First, multiply the matching components: Ax × Bx = 3 × 5 = 15, and Ay × By = 4 × (−2) = −8. Adding these gives the dot product: A · B = 15 + (−8) = 7 — exactly what the diagram above shows for the default example.
Next, find each vector's magnitude: |A| = √(3² + 4²) = √25 = 5, and |B| = √(5² + (−2)²) = √29 ≈ 5.39. Finally, use the geometric formula rearranged for angle: cos θ = 7 ÷ (5 × 5.39) ≈ 0.2599, so θ = arccos(0.2599) ≈ 74.9°. Because the dot product is positive, the angle between A and B is acute — less than 90 degrees.
What the Sign of the Dot Product Tells You
The sign of the dot product reveals the general relationship between two vectors without needing to calculate the exact angle. A positive dot product means the angle between the vectors is less than 90 degrees — they point in a broadly similar direction. A negative dot product means the angle is greater than 90 degrees — the vectors point in broadly opposite directions.
A dot product of exactly zero has a special meaning: it means the two vectors are perpendicular (orthogonal) to each other, at exactly 90 degrees. This zero-dot-product test is one of the most common ways perpendicularity is checked in physics, computer graphics, and engineering, since it avoids computing an inverse cosine at all — you only need to check whether A · B equals zero.
Dot Product vs. Cross Product
It's easy to confuse the dot product with the cross product since both combine two vectors, but they answer different questions and produce different kinds of results. The dot product multiplies two vectors and returns a single scalar number, and it's largest when the vectors point in the same direction, shrinking toward zero as they become perpendicular, and turning negative once they point more away from each other than toward it.
The cross product, by contrast, only applies to 3D vectors and returns a new vector perpendicular to both original vectors, with a magnitude related to the area of the parallelogram they form — it's used for finding normals, torque, and angular momentum, whereas the dot product is used for projections, work, and angle or similarity comparisons. If you also need the cross product, this calculator's sibling tool handles that separately.
Where the Dot Product Is Used
The dot product comes up constantly wherever two directional quantities need to be compared or combined into a single measurement:
- Physics, calculating work done by a force: Work = Force · Displacement
- Computer graphics and game development, checking lighting angles, surface normals, and whether objects face each other
- Machine learning, measuring similarity between vectors using cosine similarity, which is built directly on the dot product formula
- Engineering, projecting one force or vector onto the direction of another
- Robotics and navigation, testing whether a robot's heading aligns with or opposes a target direction
- Linear algebra, as the foundation for vector projections, orthogonality tests, and matrix operations
Frequently Asked Questions
How do you calculate the dot product of two vectors?
Multiply the matching x-components together and the matching y-components together, then add the two results: A · B = Ax × Bx + Ay × By. For A = (3, 4) and B = (5, −2), the dot product is 15 − 8 = 7.
What does a dot product of zero mean?
A dot product of zero means the two vectors are perpendicular (orthogonal) to each other — the angle between them is exactly 90 degrees.
How do I find the angle between two vectors using the dot product?
Rearrange the geometric dot product formula to θ = arccos( (A · B) / (|A| |B|) ). Divide the dot product by the product of the two magnitudes, then take the inverse cosine of the result.
Is the dot product a vector or a scalar?
The dot product is always a scalar — a single number, not a vector with direction. This is what distinguishes it from the cross product, which produces a vector.
What does a negative dot product mean?
A negative dot product means the angle between the two vectors is greater than 90 degrees — they point in broadly opposite directions, though not necessarily exactly opposite (180°).