Sum of Products Calculator

Calculate the dot product of two vectors by entering comma- or space-separated numbers.

Enter two equal-length vectors to compute their dot product (sum of element-wise products).

Sum of Products Calculator
Calculate the dot product of two vectors by entering comma- or space-separated numbers.

About the Sum of Products Calculator

The sum of products — more formally known as the dot product or scalar product — is a fundamental operation in linear algebra and mathematics. It takes two equal-length sequences of numbers (vectors) and returns a single scalar number. The operation is defined by multiplying corresponding elements of the two vectors together and then summing all those products. For vectors A = [a₁, a₂, …, aₙ] and B = [b₁, b₂, …, bₙ], the dot product is A · B = a₁b₁ + a₂b₂ + … + aₙbₙ. Geometrically, the dot product is closely related to the angle between two vectors. The formula A · B = ‖A‖ ‖B‖ cos(θ) shows that the dot product equals the product of the two vectors' magnitudes multiplied by the cosine of the angle between them. This geometric interpretation has profound consequences: if two vectors are perpendicular (orthogonal), their dot product is zero because cos(90°) = 0. If they point in the same direction, the dot product equals the product of their magnitudes (the maximum possible value). If they point in opposite directions, the dot product is negative. In physics, the dot product computes mechanical work: work = force · displacement, where both force and displacement are vectors and work is the scalar result. In machine learning and data science, the dot product is the core operation in neural networks — every layer's output is a sum of products of weights and inputs. In computer graphics, the dot product between a surface normal and a light direction vector determines how bright a surface appears — this is the foundation of the Lambertian shading model used in virtually every 3D renderer. This calculator accepts vectors of any length. You can enter elements separated by commas (e.g., 1, 2, 3) or spaces (e.g., 1 2 3). Integers, decimals, and negative numbers are all supported. The only requirement is that both vectors must have the same number of elements — if they differ in length, the dot product is undefined. Beyond its geometric and physical interpretations, the dot product is used in statistics (correlation coefficients involve sums of products), in economics (total cost = quantity vector dotted with price vector), and in signal processing (convolution and correlation operations are built on sums of products). Understanding this simple operation opens the door to a vast range of quantitative disciplines.

Sum of Products Examples

Click on any example to load it into the calculator.

Input (A · B)Dot ProductNotes
A=[1,2,3], B=[4,5,6]32(1×4)+(2×5)+(3×6) = 4+10+18 = 32. Basic dot product of two 3-element vectors.
A=[1,0,−1], B=[1,1,1]0(1×1)+(0×1)+(−1×1) = 1+0−1 = 0. Orthogonal vectors always have a dot product of zero.
A=[1.5,−2,3.1], B=[2,3.5,−1]−7.1(1.5×2)+(−2×3.5)+(3.1×−1) = 3−7−3.1 = −7.1. Negative result means vectors point in roughly opposite directions.
A=[5,2,10], B=[1.5,4,0.75]23Real-world cost: quantities [5,2,10] dotted with prices [1.50,4.00,0.75] = 7.5+8+7.5 = 23.

How to Use the Sum of Products Calculator

  1. Enter the elements of Vector A in the first field, separated by commas or spaces (e.g., 1, 2, 3 or 1 2 3).
  2. Enter the elements of Vector B in the second field using the same format. Both vectors must have the same number of elements.
  3. Click 'Calculate Sum of Products'. The calculator multiplies corresponding elements and sums the products.
  4. Read the dot product result. A positive value means the vectors point in generally the same direction; negative means roughly opposite; zero means orthogonal.
  5. Click 'Reset' to clear both fields for a new calculation.

Sum of Products FAQ

What is the difference between dot product and cross product?
The dot product (sum of products) takes two vectors of any length and returns a scalar — a single number. The cross product is defined only for 3D vectors and returns a new vector perpendicular to both inputs. Use the dot product when you need a scalar measure of alignment or projection; use the cross product when you need a perpendicular vector.
Why does a zero dot product mean the vectors are perpendicular?
The geometric formula A · B = ‖A‖ ‖B‖ cos(θ) shows the dot product equals zero when cos(θ) = 0, which occurs when θ = 90°. Two vectors at a right angle are called orthogonal, and their dot product is always exactly zero regardless of their magnitudes.
What does a negative dot product mean?
A negative dot product means the angle between the two vectors is greater than 90°, so cos(θ) is negative. Geometrically, the vectors point in generally opposite directions. A strongly negative dot product (close to −‖A‖‖B‖) means they point in almost exactly opposite directions.
How is the dot product used in machine learning?
In neural networks, each neuron computes a weighted sum of its inputs, which is exactly the dot product of a weight vector and an input vector. Matrix multiplication — the backbone of deep learning — is a systematic collection of dot products. The dot product also appears in the attention mechanism used in transformer models like large language models.
Do both vectors need to have the same length?
Yes, the dot product is only defined when both vectors have the same number of elements. If they differ in length, the operation is undefined and the calculator will show an error. Make sure you have the same count of numbers in each field before calculating.
Can I use this calculator for more than 3 dimensions?
Yes. The calculator works for vectors of any length — 2D, 3D, 4D, or any higher dimension. Simply enter all the elements separated by commas or spaces. The calculation is the same regardless of dimensionality: multiply corresponding elements and sum the results.