Hadamard Product Calculator

Enter two matrices of the same size to compute their Hadamard (element-wise) product A∘B, where each entry of the result is the product of the corresponding entries in A and B.

Quick Facts

Definition
(A∘B)ij = Aij × Bij
Each entry of the result is the product of the matching entries in A and B — no summation involved.
Size requirement
A and B must be the same size
Both matrices need identical row and column counts — unlike standard matrix multiplication.
Also known as
Schur product / entrywise product
Named after French mathematician Jacques Hadamard.

Your Results

Calculated
Hadamard Product A∘B
-
Entrywise product matrix
Matrix Dimensions
-
Rows × Columns
Sum of Entries
-
Σ (A∘B)ij
Frobenius Norm
-
√(Σ (A∘B)ij²)

Ready

Enter two matrices of the same size, then press Calculate.

How the Hadamard Product works

The Hadamard product (also called the Schur product or entrywise product) combines two matrices of identical dimensions by multiplying each pair of corresponding entries. For matrices A and B that are both m × n, the Hadamard product A∘B is also m × n, defined entry-by-entry as (A∘B)ij = Aij × Bij. This calculator parses the two matrices you enter, checks that their dimensions match, and multiplies them element-wise to produce A∘B, along with its entry sum and Frobenius norm.

Formula and method

Every entry in the result matrix comes from multiplying the entry in the same row-and-column position from A and from B — there is no summing across a row or column, unlike standard matrix multiplication. Because the operation works position-by-position, A and B must have exactly the same number of rows and the same number of columns; neither matrix needs to be square. The Hadamard product is commutative (A∘B = B∘A), associative ((A∘B)∘C = A∘(B∘C)), and distributes over matrix addition (A∘(B+C) = A∘B + A∘C).

Hadamard product vs. matrix multiplication

Don't confuse the Hadamard product with standard matrix multiplication A×B, which requires the number of columns in A to equal the number of rows in B and computes each output entry as a dot product — a sum of pairwise products — across a row of A and a column of B. The Hadamard product instead requires identical dimensions in both matrices and never sums across positions; it is a simpler, purely elementwise operation, and the result is always the same size as the two inputs.

Common mistakes

  • Mismatched dimensions: attempting A∘B when A is 2×3 and B is 3×2 — dimensions must match exactly, row-for-row and column-for-column.
  • Confusing it with matrix multiplication: applying the row-by-column dot-product rule instead of simple position-by-position multiplication.
  • Ragged rows: entering a matrix where one row has a different number of values than another — every row must have the same number of entries.

Applications

  • Neural networks: gating mechanisms in LSTM and GRU networks, dropout masks, and attention mechanisms multiply activations elementwise using the Hadamard product.
  • Image processing: applying a mask or filter to an image elementwise, such as blending or masking pixel intensities.
  • Statistics: scaling a covariance or correlation matrix entrywise, or computing entrywise variances.
  • Signal processing: windowing a signal by multiplying it elementwise with a window function.

Frequently Asked Questions

What is the Hadamard product of two matrices?
The Hadamard product (or Schur product) of two matrices A and B of the same size is the matrix A∘B whose entries are the products of the corresponding entries: (A∘B)ij = Aij × Bij. For example, [[1,2],[3,4]] ∘ [[5,6],[7,8]] = [[5,12],[21,32]].
How is the Hadamard product different from regular matrix multiplication?
Regular matrix multiplication A×B computes each output entry as the dot product of a row of A and a column of B, and requires A's column count to equal B's row count. The Hadamard product A∘B multiplies matrices of identical dimensions entry-by-entry, with no summation across rows or columns, producing a result the same size as both inputs.
Do the two matrices need to be the same size?
Yes. The Hadamard product is only defined when A and B have exactly the same number of rows and the same number of columns. If the dimensions don't match, the operation is undefined and this calculator will show an error.
What is the Hadamard product used for?
It is widely used in machine learning (gating in LSTM/GRU networks, attention masks, dropout), image processing (applying masks or filters pixel-by-pixel), and statistics (elementwise scaling of covariance matrices).