Hadamard Product Calculator

Enter two matrices of the same dimensions and compute their Hadamard product (element-wise multiplication). Set the matrix size (rows and columns), then fill in values for Matrix A and Matrix B. The calculator returns the result matrix where each element is the product of the corresponding entries from A and B.

Both matrices must have the same number of rows (max 5).

Both matrices must have the same number of columns (max 5).

Enter each row separated by a semicolon (;) and each element by a comma (,). Example: 1,2;3,4

Must have the same dimensions as Matrix A. Example: 5,6;7,8

Results

Hadamard Product (A ∘ B)

--

Result Matrix Dimensions

--

Sum of All Result Elements

--

Maximum Element in Result

--

Minimum Element in Result

--

Result Matrix Elements (flattened)

Results Table

Frequently Asked Questions

What is the Hadamard product?

The Hadamard product (also called element-wise or Schur product) is an operation on two matrices of the same dimensions that produces a third matrix where each element (i,j) is the product of elements (i,j) from the two input matrices. It is denoted A ∘ B and is different from standard matrix multiplication.

How do I find the Hadamard product?

To compute the Hadamard product, multiply each element of the first matrix by the corresponding element at the same position in the second matrix. For example, if A = [[1,2],[3,4]] and B = [[5,6],[7,8]], then A ∘ B = [[1×5, 2×6],[3×7, 4×8]] = [[5,12],[21,32]].

Do both matrices need to have the same size?

Yes. The Hadamard product is only defined when both matrices have exactly the same number of rows and columns. The resulting matrix will also have those same dimensions. If the sizes differ, the operation is undefined.

What are the properties of the Hadamard product?

The Hadamard product is commutative (A ∘ B = B ∘ A), associative (A ∘ (B ∘ C) = (A ∘ B) ∘ C), and distributive over addition (A ∘ (B + C) = (A ∘ B) + (A ∘ C)). It also interacts with the Kronecker product: (A⊗B) ∘ (C⊗D) = (A∘C) ⊗ (B∘D).

How do I compute the Hadamard product of vectors?

Vectors are simply matrices with one row or one column. Apply the same rule: multiply corresponding elements at the same index. For vectors u = [1,2,3] and v = [4,5,6], the Hadamard product is [1×4, 2×5, 3×6] = [4, 10, 18].

Is the Hadamard product the same as the tensor (Kronecker) product?

No, they are different operations. The Hadamard product multiplies corresponding elements of two same-sized matrices producing a same-sized result. The Kronecker (tensor) product combines every element of one matrix with the entire second matrix, producing a much larger matrix.

What is the matrix rank under Hadamard product?

The rank of the Hadamard product A ∘ B satisfies rank(A ∘ B) ≤ rank(A) × rank(B). Unlike standard matrix multiplication, the Hadamard product can sometimes increase or preserve rank in ways standard multiplication does not.

Where is the Hadamard product used in practice?

The Hadamard product is widely used in neural networks (element-wise activation gating), signal processing, statistics (covariance computations), and image processing (pixel-wise operations). It is a fundamental building block in modern deep learning architectures like LSTMs and attention mechanisms.

More Math Tools