Dot Product Calculator
This dot product calculator multiplies two vectors into a single number, keeps every step in exact fractions, and gives a definite answer to the question most people came with: are these two perpendicular?
Type <2, 3> . <3, −2> and you get 0. Not 0.0000000001. Zero, so the vectors are at right angles and the proof is finished.
The Easiest Calculation in the Subject
Multiply the matching components. Add them. Stop.
⟨3, 4⟩ · ⟨1, 2⟩ = 3×1 + 4×2 = 11. In three dimensions a third product joins the sum and nothing else changes.
What comes out is a plain number, which is why it is also called the scalar product. The directions have gone. Two arrows went in and an ordinary quantity came out, and that turns out to be far more useful than it sounds.
What That Number Is Telling You
The dot product measures how much the two vectors agree about which way to point.
Positive, and they lean the same way — the angle between them is under 90°. Negative, and they lean apart — over 90°. Zero, and they are at right angles exactly.
You can read all of that off the sign before working out any angle at all, which is worth doing. In a physics problem a negative dot product usually means a force is fighting the motion rather than helping it, and that is often the whole answer.
Zero Means Perpendicular, and Only Exact Zero Will Do
Here is why exact arithmetic matters on a page like this one.
Asked to prove ⟨2, 3⟩ and ⟨3, −2⟩ are perpendicular, you do not find the angle. You write 6 − 6 = 0 and you are done. That is the whole proof and it is one line long.
Now try it on a calculator that works in decimals. It shows you 0, or it shows you 0.0000000001, and you cannot tell which of those is a real zero and which is rounding. A page that cannot distinguish them cannot answer the question you asked. Everything here stays a whole-number fraction from the moment your input is read, so zero is zero.
| If a · b is | The vectors | The angle |
|---|---|---|
| positive | lean the same way | under 90° |
| zero | are perpendicular | exactly 90° |
| negative | lean apart | over 90° |
| as big as it can get | are parallel | 0° or 180° |
The Other Formula, and Why It Matters
There are two ways to write a dot product and they are the same thing:
a · b = a₁b₁ + a₂b₂ and a · b = |a| |b| cos θ
The first is how you calculate it. The second is what it means. Setting them equal is how the angle falls out, and it is why the dot product turns up in every question about directions rather than only in arithmetic exercises.
It also explains the sign immediately. Lengths are never negative, so the sign of the dot product is the sign of cos θ, and cos is negative exactly when the angle passes 90°.
A Guarantee Worth Having
There is a way for a dot product page to fail that most users never see and some do.
To get the angle you divide the dot product by the two lengths multiplied. Done in ordinary decimals, that division comes out as 1.0000000000000002 for two vectors that are simply parallel — and the inverse cosine of anything above 1 is not a number at all.
That is not a rare corner. Put twenty thousand pairs of parallel vectors with whole-number components through the decimal route and 3,706 of them overshoot, returning an error instead of 0°. Nearly one in five.
This one checks, in whole numbers, that (a · b)² is never larger than (a · a)(b · b) before it goes near an inverse cosine. That inequality is always true in mathematics; checking it in exact arithmetic is what makes it always true in the code as well. The two sides come out equal precisely when the vectors are parallel, which is how this page knows to tell you so.
How to Use This Dot Product Calculator
Put each vector in brackets, one after the other: <3, 4> . <1, 2>. The dot between them is optional, since the brackets already show where one vector ends. Two components or three, and fractions stay fractions — ⟨1/2, 1/3⟩ · ⟨1/3, 1/2⟩ comes back as 1/3, not 0.3333.
The band gives the dot product, what its sign means, and the angle it implies, with the cosine as an exact surd where one exists. Those two lengths are the same ones the magnitude and direction page works through, and if you need the resultant of the same pair rather than their product, that is vector addition. A direction on its own is a unit vector.
Nothing is printed until the answer has been through several checks: that a · b equals b · a, that the inequality above holds, that the cosine squared matches the exact ratio it should, and that a zero dot product really does correspond to 90°. The number of checks that passed appears with the working.
Dot Product Calculator FAQ
How do you find the dot product of two vectors?
What does the dot product tell you?
How do you prove two vectors are perpendicular?
Is the dot product a vector or a number?
Does the order matter in a dot product?
What is the dot product formula with the angle?
Can the dot product be negative?
What is the dot product of a vector with itself?
Multiply, add, then look at the sign before you reach for anything else.