Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Matrix Scalar Multiplication

How to use
  1. The Dimensions of A steppers (▲ / ▼) set the rows and columns of AA, each from 1 to 5; CC takes the same shape automatically. Learn more about choosing dimensions
  2. Hover the ? icon for what a scalar is and why the shape of AA is kept. Learn more about getting started
  3. ▶ Play runs the sweep, Next → and ← Back move one cell at a time, Reset returns to the opening scene, and the speed menu sets the pace from Slow to Very Fast. Learn more about the controls
  4. Each scene lights one entry of AA and its destination in CC, with an arrow between them and ci,j=k⋅ai,jc_{i,j} = k \cdot a_{i,j} as its title. Learn more about reading a scene
  5. The Step explanations log keeps every completed step with its formula and a note linking to the matching section below. Learn more about the step log


Symbolic visualization of k · A = C, cell by cell.

Dimensions of A?A scalar is a single number — not a vector or matrix. Multiplying by a scalar k preserves shape: the result has the same dimensions as the input, and every entry equals k times the corresponding input entry. The same idea applies to vectors and to matrices — only the shape of the operand differs.
A2×3
k·
A2×3
a1,1
a1,2
a1,3
a2,1
a2,2
a2,3
=
C2×3
?
?
?
?
?
?
Step 1 / 8

Step explanations

1Scalar multiplication
k is a scalar — a single number. To compute C = k · A, multiply every cell of A by k. C has the same shape as A (2×3).
No shape rule to satisfy - k multiplies a matrix of any dimensions. Learn more about the opening scene · what it is









Key Terms

Scalar — a single number, not a vector or matrix.

Scalar multiplication — the operation kAkA that multiplies every entry of a matrix AA by the scalar kk.

Element-wise operation — applied independently to each entry; the result at (i,j)(i,j) depends only on kk and ai,ja_{i,j}.

Shape preservation — kAkA has the same dimensions as AA. Scalar multiplication never changes the shape.

Scaling factor — the role kk plays: it stretches (∣k∣>1|k| > 1), shrinks (∣k∣<1|k| < 1), or flips sign (k<0k < 0) every entry uniformly.

Zero scalar — multiplying by k=0k = 0 produces the zero matrix of the same shape as AA.

Getting Started with the Visualizer

DemoShape, play, reset
Step 0 of 5
Set the shape of AA and watch kA=CkA = C build one cell at a time.

• Use the Dimensions steppers to set the shape of AA (1 to 5 in each direction)
• CC inherits the same shape automatically
• Hover the ? icon for a reminder of what a scalar is and why the shape is preserved
• Press play or step manually through the scene player; the speed selector and step log let you control pace and review

The scalar kk is shown symbolically in front of AA. The visualizer focuses on the structural rule — every cell of AA gets multiplied by the same kk — not on any specific numerical value of kk.

Reading the Scene Player

DemoReading one scene
Step 0 of 5
Each scene focuses on one cell of CC.

• The active cell in AA is highlighted primary; the destination cell in CC is highlighted accent
• A curved arrow flows from ai,ja_{i,j} into ci,jc_{i,j}, showing the scalar being applied
• Each filled cell of CC shows its symbolic content k⋅ai,jk \cdot a_{i,j}
• The step log on the right keeps a record of completed cells

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

The Opening Scene: One Number and One Matrix

The player starts with the scalar kk, the matrix AA, and an empty CC waiting for the result. At the default dimensions AA is 2×32 \times 3, so CC will be 2×32 \times 3 as well.

Only the setup is on screen: a single number on one side, six entries on the other, and the statement that C=k⋅AC = k \cdot A is about to be built cell by cell.
k·A2×3a1,1a1,2a1,3a2,1a2,2a2,3=C2×3??????
Opening scene, frozen

The scalar k beside A at 2×3, with C empty. Every cell of C shows the placeholder - no shape precondition to satisfy, since k meets each entry on its own.

Unlike addition, this operation has no matching-shape precondition — there is nothing to match. A scalar can multiply a matrix of any dimensions, because it meets every entry individually rather than pairing off against a second grid.

That also fixes the output shape immediately. CC has exactly the dimensions of AA, whatever kk happens to be, and no choice of kk can add or remove an entry.

One Cell at a Time

Each step highlights a single entry of AA together with its destination in CC, and writes k⋅ai,jk \cdot a_{i,j} into that slot.

The frozen picture below is a step partway through the 2×32 \times 3 run: some cells of CC already hold their scaled value, one is being computed, and the rest are still placeholders.
k·A2×3a1,1a1,2a1,3a2,1a2,2a2,3=C2×3k·a1,1k·a1,2k·a1,3k·a2,1??
Mid-sweep, frozen

One entry of A and its destination in C highlighted together. Earlier cells of C already hold k times their entry; later ones are still placeholders.

The same kk is used at every step. That is the entire content of the operation — six multiplications that share one factor — and it is why scalar multiplication is so much simpler than the matrix product, where each output entry consumes a whole row and a whole column.

Because each cell is independent, the order of the sweep is again a presentational choice. Nothing in c2,3c_{2,3} depends on c1,1c_{1,1} having been computed first.

The Completed Product

The final scene fills every cell, so CC reads ci,j=k⋅ai,jc_{i,j} = k \cdot a_{i,j} throughout, at the same 2×32 \times 3 shape it started with.

Written that way the defining property is visible at a glance: one factor, applied everywhere.
k·A2×3a1,1a1,2a1,3a2,1a2,2a2,3=C2×3k·a1,1k·a1,2k·a1,3k·a2,1k·a2,2k·a2,3
Completed product, frozen

All six cells filled with k times the entry above, and C still 2×3. One factor, applied everywhere.

The algebraic rules all follow from that. Scalar multiplication distributes over matrix addition, k(A+B)=kA+kBk(A + B) = kA + kB, and over scalar addition, (k+m)A=kA+mA(k + m)A = kA + mA; it is associative with scalars, (km)A=k(mA)(km)A = k(mA); and 1⋅A=A1 \cdot A = A while 0⋅A0 \cdot A is the zero matrix. Those are precisely the axioms that make the set of 2×32 \times 3 matrices a vector space.

Two consequences are worth knowing because they are easy to get wrong. The trace scales linearly, tr⁡(kA)=ktr⁡(A)\operatorname{tr}(kA) = k \operatorname{tr}(A), since every diagonal entry picks up one factor of kk. The determinant does not: for an n×nn \times n matrix, det⁡(kA)=kndet⁡(A)\det(kA) = k^n \det(A), because the determinant collects one factor of kk from each of the nn rows. Doubling a 3×33 \times 3 matrix multiplies its determinant by eight, not by two.

Choosing Dimensions

DemoAny shape works
Step 0 of 5
The dimension steppers control the shape of AA, and CC follows automatically.

• Start with 2×22 \times 2 or 2×32 \times 3 to see the per-cell flow clearly
• Increase to 4×44 \times 4 or 5×55 \times 5 to see how the same rule scales — total scenes equal m×nm \times n
• Symbolic content in CC shrinks automatically as the matrix grows, so k⋅ai,jk \cdot a_{i,j} stays readable
• Square and rectangular shapes follow identical rules — scalar multiplication has no shape restriction

What Scalar Multiplication Is

Scalar multiplication takes a number kk and a matrix AA and produces a matrix kAkA of the same shape, with every entry multiplied by kk:

(kA)i,j=k⋅ai,j(kA)_{i,j} = k \cdot a_{i,j}


It's the simplest non-trivial matrix operation. There are no shape restrictions — any matrix can be scaled. The result is the same shape as AA, and every cell depends only on kk and its own value in AA.

Scalar multiplication is the multiplicative companion to matrix addition: both are element-wise, both preserve shape, and together they make matrices into a vector space.

For comprehensive theory, see matrix operations.

Key Properties

Scalar multiplication satisfies clean algebraic rules.

• Associativity with scalars: (kl)A=k(lA)(kl)A = k(lA)
• Distributivity over matrix addition: k(A+B)=kA+kBk(A + B) = kA + kB
• Distributivity over scalar addition: (k+l)A=kA+lA(k + l)A = kA + lA
• Identity scalar: 1⋅A=A1 \cdot A = A
• Zero scalar: 0⋅A=00 \cdot A = 0 (zero matrix of the same shape)
• Sign flip: (−1)⋅A=−A(-1) \cdot A = -A
• Compatibility with transpose: (kA)T=kAT(kA)^T = k A^T
• Compatibility with matrix multiplication: k(AB)=(kA)B=A(kB)k(AB) = (kA)B = A(kB)

These properties are exactly the eight vector-space axioms for scalar multiplication.

Why It Matters

Scalar multiplication is the operation that lets matrices form a vector space, and it appears everywhere combinations of matrices appear.

• Linear combinations: any expression c1A1+c2A2+⋯+cnAnc_1 A_1 + c_2 A_2 + \cdots + c_n A_n uses scalar multiplication
• Normalization: dividing AA by a norm or a trace is scalar multiplication by 1/∥A∥1/\|A\| or 1/tr(A)1/\text{tr}(A)
• Sign changes: −A-A is just scalar multiplication by −1-1
• Scaling transformations: in geometry, kAkA applied to a vector scales the result uniformly
• Differential equations and physics: scaling the coefficient matrix of a system rescales the solution
• Gradient descent and optimization: the step θ←θ−η∇L\theta \leftarrow \theta - \eta \nabla L uses scalar multiplication of the gradient by the learning rate η\eta

Worked Example

Take AA as a 2×32 \times 3 matrix and k=3k = 3:

A=(1−2405−3)A = \begin{pmatrix} 1 & -2 & 4 \\ 0 & 5 & -3 \end{pmatrix}


Then 3A3A multiplies every entry by 3:

3A=(3−612015−9)3A = \begin{pmatrix} 3 & -6 & 12 \\ 0 & 15 & -9 \end{pmatrix}


With k=−1k = -1 instead:

−A=(−12−40−53)-A = \begin{pmatrix} -1 & 2 & -4 \\ 0 & -5 & 3 \end{pmatrix}


And with k=0k = 0, the result is the 2×32 \times 3 zero matrix.

Set the visualizer to 2×32 \times 3 and step through to see this animated symbolically.

Common Mistakes

A few mistakes recur.

• Multiplying only the first entry or only the diagonal — kk multiplies every entry, not a privileged subset
• Confusing scalar multiplication with the Hadamard product — kAkA uses a single number; Hadamard product uses an entire matrix of multipliers
• Confusing scalar multiplication with matrix multiplication — there is no row-column pairing; scalar multiplication is purely element-wise
• Thinking the shape changes — kAkA always has the same shape as AA, regardless of kk
• Forgetting sign flips count as scalar multiplication — −A-A is (−1)⋅A(-1) \cdot A