Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Inner Product of Vectors

How to use
  1. The Vector length stepper (▲ / ▼) sets the length shared by uu and vv, from 22 to 1010; the player returns to its first scene. Learn more about getting started
  2. ▶ Play runs the whole sum, Next → and ← Back move one scene, Reset returns to the opening scene, and the speed menu sets the pace from Slow to Very Fast. Learn more about the controls
  3. Each scene pairs uku_k (blue) with vkv_k (grey) and draws two arrows into the ⟨u,v⟩\langle u, v \rangle box. Learn more about the vectors scenario
  4. The final scene turns every entry of uu and vv and the result box green: one scalar from nn products. Learn more about the completed sum
  5. Each card in the Step explanations log writes the sum out term by term: grey is pending, blue and bold is the current term, green is already counted. Learn more about reading the running sum


Symbolic visualization of ⟨u, v⟩ (vectors) and ⟨A, B⟩_F (Frobenius), step by step.

Vector length
u, vlength4
u1×4
u1,1
u1,2
u1,3
u1,4
,
v1×4
v1,1
v1,2
v1,3
v1,4
=
⟨u,v⟩
4Σk=1ukvk
Step 1 / 6

Step explanations

1Vector inner product
The inner product of two vectors of the same length pairs them index by index, multiplies, and sums to a single scalar.
⟨u, v⟩ = u1v1 + u2v2 + u3v3 + u4v4
Two vectors in, one scalar out - the only operation here that changes the kind of the answer. Learn more about the opening scene · what it is









Key Terms

Inner product — an operation that takes two objects of the same shape, multiplies their entries pairwise, and sums the products into a single scalar.

Dot product — the classical inner product of two vectors of equal length: ⟨u,v⟩=∑kukvk\langle u, v \rangle = \sum_k u_k v_k.

Frobenius inner product — the inner product of two matrices of the same shape: ⟨A,B⟩F=∑i,jai,jbi,j\langle A, B \rangle_F = \sum_{i,j} a_{i,j} b_{i,j}.

Same-shape requirement — both operands must have identical dimensions so every entry of one has a partner in the other.

Scalar result — the output of an inner product is always a single number, regardless of how large the operands are.

Inner product space — a vector space equipped with an inner product. Norms, angles, and orthogonality all derive from it.

Getting Started with the Visualizer

DemoLength, play, speed
Step 0 of 5
Pick a scenario and a shape, then watch the inner product build up term by term.

• Use the Scenario pills to switch between Vectors ⟨u,v⟩\langle u, v \rangle and Matrices ⟨A,B⟩F\langle A, B \rangle_F
• In the vectors scenario, set the shared length of uu and vv (2 to 10)
• In the matrices scenario, set the shared dimensions of AA and BB (2×2 to 5×5)
• Hover the ? icons for explanations of the inner product itself and the same-shape requirement
• Use the scene player below to step, play, pause, change speed, and scroll the step log

The point of having one tool for both scenarios is to make the unity explicit: same operation, different operands.

The Vectors Scenario

DemoPair, multiply, sum
Step 0 of 5
In the vectors scenario, uu and vv are shown as row vectors of length nn, and the result ⟨u,v⟩\langle u, v \rangle appears as a single boxed scalar.

• Each scene pairs one entry uku_k with vkv_k, highlighting both and drawing two arrows into the result box
• The running sum above the canvas updates term by term — counted terms turn green, the current term is blue and bold, pending terms stay grey
• The result box shows a stacked Σ\Sigma notation with an upper bound that advances as more terms are counted
• Final scene highlights every entry of both vectors and the completed sum

This is the textbook dot product, broken into its nn pairwise products.

The Opening Scene: Two Vectors, One Number

The player starts with u\mathbf{u} and v\mathbf{v} side by side and the result slot ⟨u,v⟩\langle \mathbf{u}, \mathbf{v} \rangle waiting empty. At the default length both vectors have four components.

The running-sum line beneath the vectors is already laid out with all four terms, greyed until each is earned. What the scene announces is the shape of the answer: two vectors go in, one number comes out.
u1×4u1,1u1,2u1,3u1,4,v1×4v1,1v1,2v1,3v1,4=⟨u,v⟩
Opening scene, frozen

u and v as four-component rows with the result slot empty between the brackets. Two vectors in, one number out - the shape of the answer is the first thing established.

That output shape is what separates the inner product from every other operation in this section. Addition and scalar multiplication return vectors of the same length; this one collapses the whole pair to a single scalar, which is why it is also called the scalar product.

The same-length precondition still applies, and for the same reason as addition: the definition pairs components by position, so each uju_j needs a vjv_j to meet.

Pairing, Multiplying, Accumulating

Each step highlights uju_j and vjv_j together, multiplies them, and adds the product into the running total. The term for that step turns solid in the sum line while the later terms stay greyed.

The frozen picture below is a step partway through the run — some terms already contributed, one being computed, the rest still pending.
u1×4u1,1u1,2u1,3u1,4,v1×4v1,1v1,2v1,3v1,4=⟨u,v⟩
Mid-sweep, frozen

One component of u and the component opposite it in v highlighted as a pair. Their product is what joins the running total at this step.

Two operations are interleaved here, and it is worth separating them. The pairing and multiplying is componentwise, exactly like the operations on the neighbouring pages. The summing is what makes this different: it destroys the positional structure, folding four independent products into one total.

Because the products are summed rather than kept, information is lost on purpose. Many different pairs of vectors give the same inner product, and that is the point — the number measures one specific relationship between them rather than describing them.

The Completed Inner Product

The final scene fills the result slot with the total, so the sum line reads

⟨u,v⟩=u1v1+u2v2+u3v3+u4v4\langle \mathbf{u}, \mathbf{v} \rangle = u_1v_1 + u_2v_2 + u_3v_3 + u_4v_4

a single scalar standing where four products were.
u1×4u1,1u1,2u1,3u1,4,v1×4v1,1v1,2v1,3v1,4=⟨u,v⟩
Completed inner product, frozen

The result slot filled with a single scalar. Four products have been summed away into one number, and the positional structure is gone.

That number carries a great deal. Taking the inner product of a vector with itself gives ∑uj2\sum u_j^2, which is the squared length — so ∥u∥=⟨u,u⟩\|\mathbf{u}\| = \sqrt{\langle \mathbf{u}, \mathbf{u} \rangle}, and the whole notion of distance in Rn\mathbb{R}^n is built from this operation.

Between two different vectors it measures alignment, through ⟨u,v⟩=∥u∥ ∥v∥cos⁡θ\langle \mathbf{u}, \mathbf{v} \rangle = \|\mathbf{u}\|\,\|\mathbf{v}\|\cos\theta. The sign alone is informative: positive means the vectors lean the same way, negative means they oppose, and zero means they are orthogonal. That last case is the reason the inner product underpins projections, least squares and orthogonal bases.

The operation is symmetric, ⟨u,v⟩=⟨v,u⟩\langle \mathbf{u}, \mathbf{v} \rangle = \langle \mathbf{v}, \mathbf{u} \rangle, and linear in each argument — properties that follow directly from the componentwise products being summed.

The Matrices Scenario

In the matrices scenario, AA and BB are shown as m×nm \times n grids, and the result ⟨A,B⟩F\langle A, B \rangle_F appears as a single boxed scalar with the Frobenius subscript FF.

• Each scene pairs one entry ai,ja_{i,j} with bi,jb_{i,j} in row-major order, highlighting both and drawing arrows into the result box
• The running sum above the canvas grows by one ai,jbi,ja_{i,j} b_{i,j} term per step, color-coded the same way as in the vectors scenario
• Total steps equal m×nm \times n — every cell of both matrices contributes exactly one product
• Final scene highlights every cell of both matrices in green and presents the completed sum

The Frobenius inner product is exactly the dot product of the matrices "flattened" into long vectors of length m×nm \times n.

Reading the Running Sum

DemoGrey, blue, green
Step 0 of 4
The expression above the canvas is the inner product written out as a sum of individual product terms, with per-term color coding.

• Grey terms are pending — not yet computed
• Blue, bold marks the term being computed in the current scene
• Green terms have already been counted
• On the final scene, every term is green and the sum is complete

This running sum is the bridge between the visual pairing (highlights and arrows on the canvas) and the algebraic formula. By the end of the animation, you have seen every term in the sum named, paired, and counted.

What an Inner Product Is

An inner product is a rule that takes two objects of the same shape and returns a scalar by pairing entries, multiplying, and summing.

For vectors of length nn:
⟨u,v⟩=∑k=1nukvk\langle u, v \rangle = \sum_{k=1}^{n} u_k v_k


For m×nm \times n matrices (the Frobenius inner product):
⟨A,B⟩F=∑i=1m∑j=1nai,jbi,j\langle A, B \rangle_F = \sum_{i=1}^{m} \sum_{j=1}^{n} a_{i,j} b_{i,j}


Both formulas implement the same idea: walk through every pair of corresponding entries, multiply them, sum the products. The Frobenius version is the dot product applied to the matrices read as mnmn-long vectors.

For comprehensive theory, see inner product spaces.

Key Properties

Every inner product, whether on vectors or matrices, satisfies four defining properties.

• Symmetry: ⟨u,v⟩=⟨v,u⟩\langle u, v \rangle = \langle v, u \rangle
• Linearity in the first argument: ⟨αu+βw,v⟩=α⟨u,v⟩+β⟨w,v⟩\langle \alpha u + \beta w, v \rangle = \alpha \langle u, v \rangle + \beta \langle w, v \rangle
• Positive definiteness: ⟨u,u⟩≥0\langle u, u \rangle \geq 0, with equality only when u=0u = 0
• Scalar output: the result is always a single number, never a vector or matrix

From these four properties everything else follows — norms (∥u∥=⟨u,u⟩\|u\| = \sqrt{\langle u, u \rangle}), angles (cos⁡θ=⟨u,v⟩/(∥u∥∥v∥)\cos\theta = \langle u, v \rangle / (\|u\| \|v\|)), orthogonality (⟨u,v⟩=0\langle u, v \rangle = 0), and projections.

Why It Matters

The inner product is the single most useful operation in linear algebra because so many other concepts are defined through it.

• Length of a vector: ∥u∥=⟨u,u⟩\|u\| = \sqrt{\langle u, u \rangle}
• Angle between vectors: cos⁡θ=⟨u,v⟩/(∥u∥∥v∥)\cos\theta = \langle u, v \rangle / (\|u\| \|v\|)
• Orthogonality: u⊥vu \perp v exactly when ⟨u,v⟩=0\langle u, v \rangle = 0
• Projection of uu onto vv: projvu=⟨u,v⟩⟨v,v⟩v\text{proj}_v u = \frac{\langle u, v \rangle}{\langle v, v \rangle} v
• Gram-Schmidt orthogonalization, least squares, and Fourier expansions all run on inner products

The Frobenius inner product extends all of this to matrices — matrix norms, matrix angles, orthogonal matrix decompositions, and the trace formula ⟨A,B⟩F=tr(ATB)\langle A, B \rangle_F = \text{tr}(A^T B).

Worked Example

Vectors: take u=(1,2,3)u = (1, 2, 3) and v=(4,−1,2)v = (4, -1, 2).

⟨u,v⟩=(1)(4)+(2)(−1)+(3)(2)=4−2+6=8\langle u, v \rangle = (1)(4) + (2)(-1) + (3)(2) = 4 - 2 + 6 = 8


Matrices: take A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(01−12)B = \begin{pmatrix} 0 & 1 \\ -1 & 2 \end{pmatrix}.

⟨A,B⟩F=(1)(0)+(2)(1)+(3)(−1)+(4)(2)=0+2−3+8=7\langle A, B \rangle_F = (1)(0) + (2)(1) + (3)(-1) + (4)(2) = 0 + 2 - 3 + 8 = 7


In both cases, the calculation is "pair, multiply, sum" — no row-column gymnastics, no transposition. Set the visualizer to length 3 for the vector case or to 2×22 \times 2 for the matrix case and step through to see the same arithmetic animated.

Common Mistakes

A handful of recurring mistakes appear when learning inner products.

• Confusing inner product with matrix multiplication — the inner product returns a scalar; matrix multiplication returns a matrix. uTvu^T v is a scalar (essentially the inner product), while uvTu v^T is a rank-1 outer product matrix
• Forgetting the same-shape requirement — you cannot take the inner product of a 3-vector and a 4-vector, or of a 2×32 \times 3 and a 3×23 \times 2 matrix
• Conjugation in the complex case — for complex vectors, the inner product is ⟨u,v⟩=∑uk‾vk\langle u, v \rangle = \sum \overline{u_k} v_k with conjugation on one argument. The visualizer covers the real case
• Treating Frobenius as something exotic — it is just the dot product of the matrices read as long vectors
• Mixing up "inner" and "outer" — outer product takes two vectors and returns a matrix; inner product takes two vectors and returns a scalar