Enter your vectors
Choose the number of components, then type values for vectors a and b. Works for negative numbers and decimals. Tip: you can paste a list like 1, 2, 3 into the “Quick paste” box.
Use this free Dot Product Calculator to compute a · b for two vectors in 2D up to 10D. You’ll also get the cosine similarity, the angle between vectors, and clear step-by-step working. It’s fast, mobile-friendly, and designed for screenshots (hello, homework + study group chats).
Choose the number of components, then type values for vectors a and b. Works for negative numbers and decimals. Tip: you can paste a list like 1, 2, 3 into the “Quick paste” box.
The dot product (also called the scalar product) takes two vectors and returns a single number. In coordinate form, it is the sum of the products of matching components. If a = (a₁, a₂, …, aₙ) and b = (b₁, b₂, …, bₙ), then:
a · b = a₁b₁ + a₂b₂ + … + aₙbₙ
That’s the “multiply-and-add” definition. But the dot product has a second identity that is just as important: it connects vector coordinates to geometry. For nonzero vectors, the dot product also equals:
a · b = |a| |b| cos(θ)
This is where the dot product becomes “viral” in real life: it’s used for checking perpendicularity, computing angles, and measuring similarity between directions or features. Here are the big takeaways:
One more concept that makes the dot product incredibly useful is projection. The dot product tells you how much of one vector lies “along” another. The scalar projection of a onto b is:
compᵦ(a) = (a · b) / |b|
In physics, this shows up when you ask things like “how much force acts in the direction of motion?” In graphics, it appears when you project a point onto a line. In data science, it’s lurking inside linear regression and principal component ideas. The math is the same; the story changes.
The magnitude of an n-dimensional vector is computed using the Pythagorean idea extended to many components:
|a| = √(a₁² + a₂² + … + aₙ²)
This matters because the angle and cosine similarity are only defined if both magnitudes are nonzero. If one vector is the zero vector, the dot product is still defined (it will be 0), but the angle is not meaningful, because a zero vector has no direction.
Under the hood, the calculator follows the exact same process you’d show on paper. The only “automation” is that it keeps the arithmetic tidy and displays the steps cleanly.
You can enter vector values in two ways: fill each component field, or paste a list into the quick paste box. The calculator accepts commas or spaces (for example 1, -2, 3 or 1 -2 3). If you paste values, it automatically fills the component inputs for you.
Once we have a and b, the dot product is the sum of component-wise products: multiply a₁ × b₁, a₂ × b₂, and so on, then add them all up. The steps section shows every multiplication and the final sum.
The calculator finds |a| and |b| by squaring each component, summing the squares, then taking the square root. This is needed for cosine similarity and angle.
If both magnitudes are nonzero, we compute: cos(θ) = (a · b) / (|a||b|). Due to rounding, a computed value might be slightly above 1 or below −1 (like 1.0000000002), so we clamp it into the valid range to keep arccos stable. Then we compute θ in radians and degrees.
If |b| > 0, we also report the scalar projection of a onto b: (a · b) / |b|. If you’re doing physics or geometry, this number is often the “what portion counts?” value you’re actually looking for.
Finally, the calculator formats everything for quick sharing: it generates a short summary you can copy, paste, or send in WhatsApp/Telegram/X. People love sharing “angle between vectors” screenshots because it’s the perfect blend of “I did math” and “I’m not doing this by hand.”
Let a = (1, 2, 3) and b = (4, 5, 6). The dot product is:
a · b = 1·4 + 2·5 + 3·6 = 4 + 10 + 18 = 32
Because the dot product is positive, these vectors point in a generally similar direction (acute angle). The exact angle depends on their magnitudes, but the sign already gives a quick gut-check.
Let a = (1, 2) and b = (−2, 1). Compute:
a · b = 1·(−2) + 2·1 = −2 + 2 = 0
Dot product zero means the vectors are perpendicular (orthogonal) as long as neither is the zero vector. In geometry, this is a quick way to confirm a right angle without using slopes.
Let a = (3, 0) and b = (−2, 1).
a · b = 3·(−2) + 0·1 = −6
Negative dot product means the angle between vectors is obtuse (more than 90°). The vectors are “fighting” each other directionally.
Suppose two vectors represent feature directions, like word embeddings or normalized measurements. The dot product alone changes with scale, but cosine similarity ignores scale and focuses on direction: cos(θ) near 1 means “very similar,” near 0 means “unrelated,” and near −1 means “opposites.”
That’s why many ML pipelines normalize vectors first: when |a| = |b| = 1, the dot product is the cosine similarity. Same formula, cleaner interpretation.
The dot product appears in geometry (angles and perpendicularity), physics (work, force components), computer graphics (lighting and shading), and data science (cosine similarity, projections, optimization). Any time you care about “how aligned” two directions are, the dot product is a natural tool.
Yes. A negative dot product means the vectors point mostly in opposite directions (an obtuse angle). A positive dot product suggests an acute angle. A dot product of 0 indicates perpendicular vectors (if both are nonzero).
The angle formula uses θ = arccos((a · b) / (|a||b|)). If |a| = 0 or |b| = 0, the denominator is zero. A zero vector has no direction, so an “angle” isn’t meaningful. The calculator will still compute the dot product (it will be 0), but it will not pretend the angle is defined.
Not always. Cosine similarity is (a · b) / (|a||b|). If both vectors are normalized to length 1, then the dot product equals cosine similarity. Otherwise, dot product mixes direction and magnitude.
If cosine similarity is 0, the vectors are perpendicular (90°) and share no directional alignment. In ML contexts, that often means “no similarity” in direction (though your actual application interpretation can vary).
You can type each component into the fields, or paste a list using commas or spaces: 1, 2, 3 or 1 2 3. Decimals and negative values are allowed (e.g., -0.5, 3.2, 10).
MaximCalculator provides simple, user-friendly tools. Double-check critical calculations and follow your assignment’s rounding rules.