Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Hadamard Product (element-wise)


Symbolic visualization of A ⊙ B = C, cell by cell. Not to be confused with standard matrix multiplication.

Dimensions (shared by A and B)?The Hadamard product (denoted A ⊙ B) multiplies matrices element-by-element: each cell of the result is the product of the corresponding cells of A and B. It requires A and B to have the same shape — the result keeps that same shape. Note: this is NOT the standard matrix product A × B. Standard multiplication pairs rows with columns and has different shape requirements; the Hadamard product just pairs cells.
A, B2×3
A2×3
a1,1
a1,2
a1,3
a2,1
a2,2
a2,3
B2×3
b1,1
b1,2
b1,3
b2,1
b2,2
b2,3
=
C2×3
?
?
?
?
?
?
Step 1 / 8

Step explanations

1Hadamard product (element-wise)
Both A and B are 2×3. To compute C = A ⊙ B, pair up each cell of A with its counterpart in B and multiply them. The result C has the same shape.












Key Terms

Hadamard product — the element-wise product of two matrices of the same shape, denoted ABA \odot B. Each entry of the result is the product of the corresponding entries: ci,j=ai,jbi,jc_{i,j} = a_{i,j} \cdot b_{i,j}.

Schur product — alternative name for the Hadamard product.

Element-wise (pointwise) operation — an operation applied independently to each pair of corresponding entries; the result at (i,j)(i,j) depends only on the inputs at (i,j)(i,j).

Same-shape requirement — both operands must have identical dimensions. A 2×32 \times 3 matrix cannot be Hadamard-multiplied with a 3×23 \times 2.

Standard matrix product — the row-by-column product A×BA \times B, a different operation with different shape rules and a different result.

$\odot$ symbol — the circle-dot operator, the standard notation distinguishing the Hadamard product from A×BA \times B or ABAB.
Learn More

Getting Started with the Visualizer

Set the shape, then watch AB=CA \odot B = C build one cell at a time.

• Use the Dimensions steppers to set the shared shape of AA and BB (1 to 5 in each direction)
• Hover the ? icon for a full explanation of the Hadamard product and how it differs from the standard matrix product
• Press play on the scene player or step manually with the back and next buttons
• Adjust speed and use the step log on the right to scroll through completed cells

There is no operation toggle — the Hadamard product is a single operation, fully determined by the shape of the operands.
Learn More

Reading the Scene Player

Each scene focuses on one cell of CC and combines highlights with arrows.

• The active cell in AA is highlighted primary, the matching cell in BB as secondary, and the destination cell in CC as accent
• Two curved arrows flow from ai,ja_{i,j} and bi,jb_{i,j} into ci,jc_{i,j}, making the data flow explicit
• Each filled cell of CC shows its symbolic content ai,jbi,ja_{i,j} \cdot b_{i,j}
• The step log on the right keeps a record of every completed cell

By the final scene, every cell of CC contains its symbolic product and the operation is complete.
Learn More

Choosing Dimensions

The dimension steppers control the shape shared by all three matrices.

• Start with a small shape like 2×22 \times 2 or 2×32 \times 3 to see each cell pairing clearly
• Increase to 4×44 \times 4 or 5×55 \times 5 to see the operation scale — total scenes equal m×nm \times n
• Symbolic cell contents in CC shrink automatically when the shape is large, so ai,jbi,ja_{i,j} \cdot b_{i,j} stays readable at 5×55 \times 5
• Square (n×nn \times n) and rectangular (m×nm \times n, mnm \neq n) shapes follow identical rules

The shape of CC is forced to match the shared shape of AA and BB — no separate control needed.
Learn More

What the Hadamard Product Is

The Hadamard product is the element-wise product of two matrices of the same shape. For m×nm \times n matrices AA and BB:

C=AB,ci,j=ai,jbi,jC = A \odot B, \quad c_{i,j} = a_{i,j} \cdot b_{i,j}


Each entry of CC depends only on the matching pair of entries in AA and BB — no row or column interaction. The result CC has the same m×nm \times n shape as the operands.

The Hadamard product is the multiplicative analogue of matrix addition: both are element-wise, both require matched shapes, both preserve dimensions. It contrasts sharply with the standard matrix product A×BA \times B, which mixes rows with columns and changes shape.

For comprehensive theory, see matrix operations.
Learn More

Hadamard vs Standard Matrix Multiplication

These two operations share the word "multiplication" but are fundamentally different.

Notation: ABA \odot B (Hadamard) vs ABA B or A×BA \times B (standard)
Shape requirement: identical shapes (Hadamard) vs inner dimensions match (standard, m×km \times k times k×nk \times n)
Result shape: same as operands (Hadamard) vs m×nm \times n (standard)
Computation: pairwise product per cell (Hadamard) vs sum of row-column products (standard)
Commutativity: commutative (Hadamard) vs generally non-commutative (standard)

For the standard product, see matrix multiplication. The two are confused often enough that the Hadamard product is sometimes spelled out as "element-wise product" to avoid ambiguity.
Learn More

Key Properties

The Hadamard product satisfies the algebraic properties one would expect from an element-wise multiplication.

Commutativity: AB=BAA \odot B = B \odot A
Associativity: (AB)C=A(BC)(A \odot B) \odot C = A \odot (B \odot C)
Distributivity over addition: A(B+C)=AB+ACA \odot (B + C) = A \odot B + A \odot C
Identity: the all-ones matrix JJ acts as identity: AJ=AA \odot J = A
Scalar pull-out: (kA)B=k(AB)(kA) \odot B = k(A \odot B)
Transpose: (AB)T=ATBT(A \odot B)^T = A^T \odot B^T

These properties mirror ordinary scalar multiplication exactly — which is unsurprising, since the operation is just scalar multiplication applied entry by entry.
Learn More

Where the Hadamard Product Appears

The Hadamard product shows up wherever data lives in matrix form but the operation needs to be local.

Machine learning: masking, gating in LSTMs and GRUs, attention weights applied element-wise
Image processing: pointwise filters and masks applied to pixel grids
Statistics: covariance scaling, weighted moment computations
Numerical linear algebra: preconditioners and diagonal scaling can be expressed as Hadamard products
Signal processing: windowing and apodization

The common thread: the matrix shape carries spatial or indexing structure, but the operation itself should not mix rows or columns.
Learn More

Worked Example

Take AA and BB as 2×32 \times 3 matrices:

A=(123456),B=(789012)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}, \quad B = \begin{pmatrix} 7 & 8 & 9 \\ 0 & 1 & 2 \end{pmatrix}


Then C=ABC = A \odot B is computed cell by cell:

C=(172839405162)=(716270512)C = \begin{pmatrix} 1 \cdot 7 & 2 \cdot 8 & 3 \cdot 9 \\ 4 \cdot 0 & 5 \cdot 1 & 6 \cdot 2 \end{pmatrix} = \begin{pmatrix} 7 & 16 & 27 \\ 0 & 5 & 12 \end{pmatrix}


Compare with the standard product A×BA \times B: it is undefined here because AA is 2×32 \times 3 and BB is also 2×32 \times 3 — the inner dimensions (33 and 22) do not match. The Hadamard product has no such restriction beyond matching shapes.
Learn More

Common Mistakes

The Hadamard product is simple, but a few recurring mistakes appear.

Confusing it with the standard matrix product — by far the most common; check the notation (\odot vs juxtaposition) and the shape rules
Trying to Hadamard-multiply matrices of different shapes — there is no broadcasting rule in the strict mathematical definition
Assuming the result is a different shapeABA \odot B has the same shape as both operands, unlike standard multiplication
Using $\cdot$ or $\times$ for the Hadamard product — these notations strongly suggest the standard product and cause confusion
Forgetting the operation is commutative — unlike standard matrix multiplication, AB=BAA \odot B = B \odot A always holds
Learn More

Related Concepts

Matrix multiplication — the standard non-element-wise product A×BA \times B, with different shape rules and very different geometric meaning.

Matrix addition — the additive element-wise operation; same shape requirement, same result-shape behavior as Hadamard.

Kronecker product — a different "tensor" product of two matrices producing a much larger result; sometimes confused with Hadamard but unrelated.

Outer product — the vector-vector product producing a rank-1 matrix; another distinct operation.

Inner product (Frobenius) — the sum of all entries of ABA \odot B equals A,BF\langle A, B \rangle_F, the Frobenius inner product.

Scalar multiplication — element-wise multiplication by a number; the Hadamard product is its matrix-by-matrix analogue.

Element-wise functions — applying ff to every entry, often combined with Hadamard products in machine learning.
Learn More