Introduction
The dot product is a way to multiply two vectors together and get a single number as the result. You take each pair of matching numbers from the two vectors, multiply them, and then add all those products together. For example, if you have vector A = (2, 3) and vector B = (4, 5), the dot product is (2 × 4) + (3 × 5) = 23. This simple operation is one of the most important tools in linear algebra and shows up everywhere in math, physics, and computer science.
The dot product tells you something useful about how two vectors relate to each other. When the dot product is zero, the two vectors are perpendicular, meaning they form a right angle. A positive result means the vectors point in a similar direction, while a negative result means they point in opposite directions. This makes the dot product helpful for finding angles between vectors, projecting one vector onto another, and solving many real-world problems.
Use this dot product calculator to quickly find the dot product of two vectors of any size. Just enter the values for each vector, and the calculator will find the dot product. This tool saves you time and helps you avoid mistakes.
How to Use Our Dot Product Calculator
Enter two or more vectors with the same number of dimensions, and this calculator will compute the dot product, the angle between vectors, and whether they are orthogonal. It also shows a full step-by-step solution, vector magnitudes, scalar projections, and a component chart.
Input Mode: Choose between "Freeform Input" or "Structured Input." Freeform lets you type vectors directly into a text box using parentheses, brackets, or angle brackets. Structured mode gives you individual number fields for each component of each vector.
Freeform Input: Type your vectors into the text area using a format like (1, 2, 3) · (4, 5, 6). You can also enter one vector per line, separated by commas. All vectors must have the same number of components. Use the optional on-screen keypad to insert numbers, brackets, and special symbols if needed.
Structured Input (Dimensions): Set the number of dimensions for your vectors. This controls how many component fields appear for each vector. The minimum is 2 and the maximum is 100.
Structured Input (Vectors): Set how many vectors you want to compare. The minimum is 2 and the maximum is 20. After choosing your dimensions and vector count, click "Build Fields" to generate the input boxes, then type a number into each component field.
Examples: Click the "Examples" button in freeform mode to see pre-built vector pairs you can load with one click. These include 2D, 3D, 5D, orthogonal, and multi-vector examples.
Calculate Dot Product: Press the "Calculate Dot Product" button to run the calculation. The results section will display the dot product value, the angle between the first two vectors in degrees, and whether the vectors are orthogonal (perpendicular). You will also see a step-by-step breakdown showing the formula, substituted values, individual products, and the final sum.
Reset: Click the "Reset" button to clear your inputs and return the calculator to its default example of (1, 2, 3) · (4, 5, 6).
What Is the Dot Product?
The dot product (also called the scalar product) is a way to multiply two vectors together and get a single number as the result. If you have two vectors with the same number of components, you multiply each matching pair of components and then add all those products together. For example, if Vector A is (1, 2, 3) and Vector B is (4, 5, 6), the dot product is (1×4) + (2×5) + (3×6) = 4 + 10 + 18 = 32.
The Dot Product Formula
The algebraic formula for the dot product of two vectors A and B, each with n components, is:
A · B = a₁b₁ + a₂b₂ + ... + aₙbₙ
This works for vectors in 2D, 3D, or any number of dimensions. The only rule is that both vectors must have the same number of components. You cannot take the dot product of a 2D vector and a 3D vector.
What Does the Dot Product Tell You?
The dot product gives you useful information about the relationship between two vectors:
- Positive result: The two vectors generally point in the same direction (the angle between them is less than 90°).
- Zero result: The two vectors are orthogonal, meaning they are perpendicular to each other (the angle between them is exactly 90°).
- Negative result: The two vectors generally point in opposite directions (the angle between them is greater than 90°).
Finding the Angle Between Two Vectors
There is a second, geometric definition of the dot product that connects it to the angle between two vectors:
A · B = ‖A‖ × ‖B‖ × cos(θ)
Here, ‖A‖ and ‖B‖ are the magnitudes (lengths) of the vectors, and θ is the angle between them. By rearranging this formula, you can solve for the angle:
θ = arccos( (A · B) / (‖A‖ × ‖B‖) )
The magnitude of a vector is found using the formula ‖A‖ = √(a₁² + a₂² + ... + aₙ²). This is simply an extension of the Pythagorean theorem to any number of dimensions.
Scalar Projection
The dot product also lets you calculate the scalar projection of one vector onto another. The scalar projection of A onto B tells you how much of Vector A points in the direction of Vector B. The formula is:
Scalar projection of A onto B = (A · B) / ‖B‖
If this value is positive, A has a component in the same direction as B. If it is negative, A has a component in the opposite direction of B.
Key Properties of the Dot Product
- Commutative: A · B = B · A. The order does not matter.
- Distributive: A · (B + C) = A · B + A · C.
- Scalar multiplication: (kA) · B = k(A · B), where k is any number.
- Self dot product: A · A = ‖A‖², which equals the square of the vector's magnitude.
Dot Product and Related Mathematical Concepts
The dot product is closely connected to many other areas of mathematics. Understanding the angle between vectors ties directly into trigonometry. The geometric formula relies on the cosine function and the Law of Cosines, which generalizes the Pythagorean theorem.
When computing the dot product by hand, you are performing basic arithmetic with multiplication and addition.
In statistics and data science, the dot product is the foundation of the correlation coefficient, since the Pearson correlation is essentially a normalized dot product.
Where Is the Dot Product Used?
The dot product shows up in many areas of math and science. In physics, it is used to calculate work, which equals the dot product of the force vector and the displacement vector.
In computer graphics, the dot product helps determine lighting and shading by measuring the angle between a surface and a light source. In machine learning, dot products are at the heart of how neural networks process data. Any time you need to measure how much two vectors align with each other, the dot product is the tool to use.