What is the Hadamard product?
The Hadamard product (also called the element-wise product, entrywise product, or Schur product) of two matrices A and B of identical dimensions is the matrix C whose every entry is the product of the corresponding entries of A and B. It is written \(C = A \circ B\). Crucially, this is not ordinary matrix multiplication: there is no summing over an inner index, just a straight entry-by-entry multiply.
How to use this calculator
Set the number of rows (j) and columns (k) shared by both matrices. Enter Matrix A and Matrix B, one row per line, with values separated by spaces or commas. Pick a display precision (significant digits) if you want more or fewer decimals shown. Both matrices must have exactly j rows and k columns — if their shapes differ, the Hadamard product is undefined and the calculator returns an error.
The formula explained
For every row index \(j\) and column index \(k\), the result is $$\left(A \circ B\right)_{jk} = a_{jk} \cdot b_{jk}, \quad j = 1 \ldots \text{Rows}, \; k = 1 \ldots \text{Cols}$$ The output matrix C keeps the same \(j \times k\) shape as the inputs. The operation is commutative (\(A \circ B = B \circ A\)) and associative, and the identity element is the all-ones matrix. Entries may be any real numbers including zero and negatives; multiplying by zero simply yields zero, and there is no division so no divide-by-zero risk.
Worked example
Let A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]. Multiplying entry by entry gives \(c_{11} = 1 \times 5 = 5\), \(c_{12} = 2 \times 6 = 12\), \(c_{21} = 3 \times 7 = 21\), \(c_{22} = 4 \times 8 = 32\), so C = [[5, 12], [21, 32]]. By contrast, the ordinary matrix product \(A \cdot B\) would be [[19, 22], [43, 50]] — clearly different, confirming this tool is element-wise.
FAQ
Does it work for vectors and scalars? Yes. Row vectors (\(1 \times k\)), column vectors (\(j \times 1\)), and scalars (\(1 \times 1\)) all work as long as A and B share the same shape.
What if A and B have different sizes? The Hadamard product is undefined; you must use matrices of identical dimensions. The calculator flags a mismatch.
What does the precision dropdown do? It only changes how many significant digits are displayed. It is a formatting choice and does not alter the underlying arithmetic.