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 do the math for you in seconds. Whether you are working on a homework problem or checking your work on a bigger project, 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. If you need to find the straight-line distance between two points in space, our Distance Calculator applies this same concept.
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. If you are working with triangles and need to find angles or sides, the Law of Sines Calculator and Right Triangle Calculator are also useful companions.
When computing the dot product by hand, you are performing basic arithmetic with multiplication and addition. For problems involving exponents within vector components, our Exponent Calculator can help, and if you need to simplify expressions or track significant figures in your results, try the Sig Fig Calculator.
In statistics and data science, the dot product is the foundation of the Correlation Coefficient Calculator, since the Pearson correlation is essentially a normalized dot product. If your vectors represent data sets, you might also want to compute the mean, median, and mode or the standard deviation of their components.
The dot product also connects to the Slope Calculator and the Midpoint Calculator when working with vectors in coordinate geometry, since slopes and midpoints describe the same geometric relationships between points that vectors formalize.
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. You can explore related physics concepts with our Force Calculator, Displacement Calculator, and Kinetic Energy Calculator, all of which involve quantities that rely on the dot product in their derivations. The Torque Calculator and Momentum Calculator also deal with vector quantities where understanding projections and angles between vectors is essential.
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.
For problems that involve rates and proportional relationships alongside vector work, tools like the Rate of Change Calculator, Ratio Calculator, and Percentage Calculator can complement your calculations. And if your work extends into calculus — where the dot product is used in gradient computations and directional derivatives — our Derivative Calculator can assist with those more advanced problems.