🧮
🧮 Math & statistics

Hadamard Product Calculator (entrywise A ∘ B of two matrices)

Results update as you type.

Your numbers

Understanding the Hadamard product calculator — concept and principle

This calculator multiplies two matrices of the same size entry by entry, the Hadamard (or Schur) product A ∘ B. It also gives the sum of all entries, which equals the Frobenius inner product ⟨A, B⟩ = trace(AᵀB), and the size. Use it in linear algebra, statistics, image processing and machine learning, where elementwise operations are common.

Hadamard productMultiply matching entriesA123456∘B789101112=A ∘ B716274055721 × 7 · 2 × 8 · 3 × 9 · 4 × 10 · 5 × 11 · 6 × 12sum of entries = ⟨A, B⟩217
Both matrices must be the same size; each entry is multiplied by its partner only.

How it is calculated

(A ∘ B)_ij = a_ij × b_ij

Sum of all entries = Σ a_ij b_ij = ⟨A, B⟩ = trace(AᵀB)

The principle

Unlike ordinary matrix multiplication, which combines rows with columns, the Hadamard product simply pairs each entry with the one in the same position. That makes it commutative and associative, with the all-ones matrix as its identity. It is used whenever one grid of numbers scales another position by position, such as applying a mask to an image or weights to a table. Summing the products gives the Frobenius inner product, the matrix version of the dot product.

Worked example

Default inputs: A = [1 2 3; 4 5 6], B = [7 8 9; 10 11 12].

  1. Row 1: 1 × 7 = 7, 2 × 8 = 16, 3 × 9 = 27.
  2. Row 2: 4 × 10 = 40, 5 × 11 = 55, 6 × 12 = 72.
  3. A ∘ B = [7 16 27; 40 55 72], size 2 × 3.
  4. Sum of all entries = 7 + 16 + 27 + 40 + 55 + 72 = 217 = ⟨A, B⟩ = trace(AᵀB).

How to read the result

Each entry of the result depends only on the matching entries of A and B. The total, 217, is a single number measuring how A and B "line up": dividing it by the Frobenius norms of A and B would give a cosine similarity between the two matrices.

Common mistakes

Keep in mind: Software uses different symbols for elementwise and matrix products (for example * versus @); check which one your tool applies.

Frequently asked questions

What is the Hadamard product?

Entry-by-entry multiplication of two matrices of the same size.

Is it commutative?

Yes, A ∘ B = B ∘ A, unlike the ordinary matrix product.

What is the Frobenius inner product?

The sum of all entries of A ∘ B, equal to trace(AᵀB).

Sources: E. W. Weisstein, "Hadamard Product", Wolfram MathWorld

Checked 9 Nov 2026. Wolfram MathWorld, “Hadamard Matrix Product” (entrywise product of two m×n matrices, also called the Schur product; commutative and associative, identity = matrix of all ones). Frobenius inner product Σ a(ij)·b(ij) = trace(AᵀB): standard identity.

🧮 All math & statistics tools →🌍 Calculators by country →