Math Solver Free

Dot Product Calculator

Dot product, magnitudes, and the angle between two vectors — instantly and free.

Vector a (a₁, a₂, a₃)

Vector b (b₁, b₂, a₃)

How to Calculate a Dot Product

The dot product (also called the scalar product) combines two vectors into a single number. That number measures how much the two vectors point the same way: it is at its largest when the vectors are parallel, exactly zero when they are perpendicular, and negative when they point in opposing directions. Enter the components of both vectors above — in 2D or 3D — and this calculator returns the dot product, both magnitudes, the angle between them in degrees and radians, and the full step-by-step working. That combination is why the dot product shows up everywhere from physics work problems to 3D graphics lighting.

The Formula

Multiply each pair of matching components, then add the products: a · b = a₁b₁ + a₂b₂ + a₃b₃. In 2D the third term simply drops away. Order does not matter — a · b always equals b · a.

Here a₁, a₂, and a₃ are the components of vector a along the x, y, and z axes, and b₁, b₂, b₃ are the matching components of vector b. The symbols |a| and |b| denote the magnitudes — the lengths — of the two vectors, each found by Pythagoras: |a| = √(a₁² + a₂² + a₃²). θ (theta) is the angle between the vectors when they are placed tail to tail. Components pair off strictly by position: first with first, second with second, never across.

How to Use the Calculator

  1. Choose the size: click “2D vectors” or “3D vectors” — 3D shows a third component box for each vector.
  2. Enter vector a: type its components into the a₁ (x), a₂ (y), and a₃ (z) fields.
  3. Enter vector b the same way in the b₁, b₂, b₃ fields, keeping the component order consistent.
  4. Press Calculate Dot Product. You get the headline a · b value, the magnitudes |a| and |b|, the angle θ in degrees and radians, and numbered steps you can compare against your own working.

Worked Example 1: (1, 2, 3) · (4, −5, 6)

  • Multiply the components: 1 × 4 = 4 · 2 × −5 = −10 · 3 × 6 = 18.
  • Add them: 4 − 10 + 18 = 12.
  • Magnitudes: |a| = √(1 + 4 + 9) = √14 ≈ 3.7417; |b| = √(16 + 25 + 36) = √77 ≈ 8.775.
  • Angle: cos θ = 12 ÷ (3.7417 × 8.775) ≈ 0.3655, so θ ≈ 68.56°.

Two sanity checks confirm the arithmetic. First, the sign: the dot product came out positive, and 68.56° is indeed acute, so the sign and the angle agree. Second, the size: a dot product can never exceed |a| × |b| ≈ 32.83, and 12 sits comfortably inside that bound. Notice the one negative component, −5, dragged the total down through its −10 product — without it, the vectors would have been much more closely aligned. If your hand calculation ever produces a dot product larger than the product of the magnitudes, a component has been mis-multiplied.

Worked Example 2: (4, 2) · (−1, 5) in 2D

  • Multiply matching components: 4 × −1 = −4 and 2 × 5 = 10.
  • Add the products: −4 + 10 = 6.
  • Magnitudes: |a| = √(16 + 4) = √20 ≈ 4.4721; |b| = √(1 + 25) = √26 ≈ 5.099.
  • Angle: cos θ = 6 ÷ (4.4721 × 5.099) = 6 ÷ 22.8035 ≈ 0.2631, so θ ≈ 74.74° (about 1.3045 radians).

This pair is a good warning against judging by one component. The x-components fight each other — 4 points right, −1 points left, contributing −4 — yet the y-components agree strongly enough (+10) to pull the total positive. The angle confirms the story: 74.74° is acute but far from parallel, exactly matching a small positive dot product relative to the maximum possible value of 22.80. Had the second vector been (−1, 2) instead, the products would be −4 and 4, the dot product exactly 0, and the vectors perfectly perpendicular.

Reading the Sign

The sign is the fastest summary of the geometry: positive means an acute angle (the vectors lean the same way), zero means exactly perpendicular, and negative means an obtuse angle (they lean apart). A zero dot product is the standard test for perpendicular vectors in exams and in code.

Where the Dot Product Earns Its Keep

In physics, work is a dot product: W = F · d multiplies a force by a displacement and automatically ignores the part of the force wasted pushing sideways. In computer graphics, the brightness of a surface is computed from the dot product of its normal vector and the light direction — face the light and the value is high, turn edge-on and it falls to zero. Game engines use it to check whether an enemy is in front of a player, and cosine similarity — the dot product of two normalised vectors — ranks search results and recommendations in machine learning.

Common Mistakes

  • Pairing the wrong components. a₁ must multiply b₁, not b₂. Writing the vectors in different orders between the two rows scrambles every product while still looking tidy.
  • Dividing by the wrong thing in the angle formula. cos θ needs the dot product divided by |a| × |b| — the product of the magnitudes, not their sum, and not one magnitude alone.
  • Expecting a vector as the answer. The dot product is a scalar. If you need a vector back — a perpendicular direction, say — you want the cross product, a different operation entirely.

Working with vectors in matrix form? The row-by-column multiplication in our matrix calculator is the dot product repeated. For lengths between points, use the distance formula calculator, and for direction of a line, the slope calculator.

Frequently Asked Questions

What is the dot product formula?

For a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), the dot product is a · b = a₁b₁ + a₂b₂ + a₃b₃: multiply each pair of matching components, then add the products. In 2D the third term simply drops away. The result is a single number — a scalar, not a vector — which is why the dot product is also called the scalar product.

What does a dot product of zero mean?

The two vectors are perpendicular (orthogonal) — they meet at exactly a 90° angle. A positive dot product means the angle between them is acute (under 90°), and a negative one means it is obtuse (over 90°). This gives the fastest perpendicularity test in vector work: if the dot product works out to exactly zero, the vectors are at right angles, no angle calculation needed.

How do you find the angle between two vectors?

Use cos θ = (a · b) ÷ (|a| × |b|), then take the inverse cosine of the result. You need the dot product and both magnitudes first; dividing the dot product by the product of the magnitudes always gives a value between −1 and 1. This calculator shows all of it — dot product, magnitudes, and the angle in degrees and radians — in one pass.

What is the dot product of (2, 3) and (4, 5)?

2 × 4 + 3 × 5 = 8 + 15 = 23. Matching components multiply, then the products add — nothing else is involved. The two vectors are nearly parallel: |a| = √13 ≈ 3.61 and |b| = √41 ≈ 6.40, so cos θ = 23 ÷ (3.61 × 6.40) ≈ 0.996, which makes the angle between them only about 5°.

What is the difference between the dot product and the cross product?

The dot product takes two vectors and returns a scalar — one number measuring how aligned they are. The cross product, which exists only in 3D, returns a brand-new vector perpendicular to both inputs, with length equal to the area of the parallelogram they span. Reach for the dot product for angles, projections, and work; reach for the cross product for perpendicular directions and areas.

Is this calculator free?

Yes — every tool on Math Solver Free is free with no sign-up, and all calculations run in your browser. Enter both vectors above and you get the dot product, the two magnitudes, the angle between the vectors, and the full step-by-step working, so you can check your own homework line by line instead of just copying an answer.

Related Tools & Guides

About the MathSolverFree Team

The MathSolverFree Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team