AI Tools Free

Matrix Multiplication Calculator

Enter two 2 × 2 arrays in row-major order (a, b, c, d) into this matrix multiplication calculator to compute their exact matrix product C = A · B in your browser. Whether you need a quick multiply matrices calculator for linear algebra homework or a multiplying matrices calculator to compose 2D transformations, the workspace evaluates all four row-by-column dot products to 12 significant digits.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate result.

Separate values with commas, spaces or new lines. At most 1,000 finite numbers, each with magnitude no greater than 1 billion.

Separate values with commas, spaces or new lines. At most 1,000 finite numbers, each with magnitude no greater than 1 billion.

Your result
Enter your details

Result will appear here

How to Multiply Matrices (2x2 Row-by-Column Formula)

The Matrix Multiplication Calculator parses four real numbers from the first input box as A = [a₁₁, a₁₂; a₂₁, a₂₂] and four real numbers from the second input box as B = [b₁₁, b₁₂; b₂₁, b₂₂]. Understanding how to multiply matrices requires pairing each row of the left matrix with each column of the right matrix rather than multiplying matching positions directly.

When learning how to multiply 2x2 matrices, each entry c_ij in row i and column j of the product C = A · B equals the dot product of row i of A with column j of B: C = [a₁₁b₁₁ + a₁₂b₂₁, a₁₁b₁₂ + a₁₂b₂₂; a₂₁b₁₁ + a₂₂b₂₁, a₂₁b₁₂ + a₂₂b₂₂].

In the zero-indexed array notation used by our JavaScript engine (a = [a0, a1, a2, a3] and b = [b0, b1, b2, b3]), the top row of C combines row 1 of A (a0, a1) with column 1 (b0, b2) to get c₁₁ = a0*b0 + a1*b2 and with column 2 (b1, b3) to get c₁₂ = a0*b1 + a1*b3. Similarly, the bottom row of C pairs row 2 of A (a2, a3) with both columns of B to produce c₂₁ = a2*b0 + a3*b2 and c₂₂ = a2*b1 + a3*b3.

Diagram of 2x2 matrix multiplication showing how rows of the first matrix dot with columns of the second matrix to produce C = A · B.
2×2 row-by-column dot-product rule: each output entry c_ij multiplies across row i of Matrix A and down column j of Matrix B.

2x2 Matrix Multiplication Calculator Reference Table

Compare these 10 standard 2 × 2 matrix products to see how order reversal (AB vs. BA), identity multiplication, inverse verification, matrix squaring, and geometric composition behave.

Operation / ScenarioMatrix A (a, b, c, d)Matrix B (e, f, g, h)Product C = A · B OutputAlgebraic / Geometric Note
Preloaded Baseline (A · B)1, 2, 3, 45, 6, 7, 819 22 / 43 50c₁₁ = 1(5)+2(7) = 19, c₂₂ = 3(6)+4(8) = 50
Reversed Order (B · A)5, 6, 7, 81, 2, 3, 423 34 / 31 46Proves non-commutativity: A · B ≠ B · A
Identity Multiplication (A · I₂)1, 2, 3, 41, 0, 0, 11 2 / 3 4Multiplying by I₂ leaves every entry unchanged
Inverse Check (A · A⁻¹ = I₂)1, 2, 3, 4-2, 1, 1.5, -0.51 0 / 0 1Confirms [-2, 1; 1.5, -0.5] is the exact inverse
Matrix Square (A² = A · A)1, 2, 3, 41, 2, 3, 47 10 / 15 22Not equal to squaring entries (1, 4, 9, 16)
Two 90° Rotations (→ 180°)0, -1, 1, 00, -1, 1, 0-1 0 / 0 -1Composing two 90° turns yields -I₂ (180°)
Horizontal Shear × Scaling1, 2, 0, 13, 0, 0, 43 8 / 0 4Scales x by 3 and shears y by 2 × 4 = 8
Fibonacci Q-Matrix Square (Q²)1, 1, 1, 01, 1, 1, 02 1 / 1 1Encodes [F₃, F₂; F₂, F₁] = [2, 1; 1, 1]
2-Step Markov Transition (P²)0.8, 0.2, 0.3, 0.70.8, 0.2, 0.3, 0.70.7 0.3 / 0.45 0.55Row probabilities continue to sum to 1.0
Non-Zero Matrices → Zero Matrix1, -1, 1, -11, 1, 1, 10 0 / 0 0Singular zero divisors can multiply to 0

How to Use the Matrix Multiplication Calculator Step by Step

Follow these three steps to enter both 2 × 2 matrices in row order, run the dot-product calculation, and export the result.

Enter Matrix A in Row Order

Paste four real numbers (a, b, c, d) into First 2 × 2 matrix, row order, separated by commas, spaces, or newlines. The first two numbers form row 1 and the last two form row 2. The box preloads 1, 2, 3, 4.

Input and settings
Step 1 capture showing the two 2x2 row-order input boxes preloaded with 1, 2, 3, 4 and 5, 6, 7, 8.
Step 1: Enter four real numbers per 2×2 matrix in row-major order into the First and Second matrix boxes.

Supply Matrix B and Verify Bounds

Fill Second 2 × 2 matrix, row order with the four entries of your right-hand multiplier (e, f, g, h), keeping every value finite and within ±1,000,000,000 (10⁹). The second box preloads 5, 6, 7, 8.

Tool result
Step 2 capture showing the computed 2x2 product 19 22 on row one and 43 50 on row two.
Step 2: Select Calculate result to evaluate the four row-by-column dot products (19 22 / 43 50).

Run and Export the Product Matrix

Click Calculate result to evaluate all four row-by-column dot products in your browser, then select Copy or Download (result.txt) to save the two-line output matrix.

Review the details
Step 3 full workspace view showing both input matrices, the 19 22 / 43 50 product, and Copy/Download actions.
Step 3: Review the two-line 2×2 product matrix and copy or download result.txt.

Worked Examples for Multiplying 2x2 Matrices

Run these three examples in the workspace to verify row-by-column arithmetic, observe why order matters (AB ≠ BA), and check an inverse matrix.

Preloaded Baseline Product (1, 2, 3, 4 × 5, 6, 7, 8 → 19 22 / 43 50)

With 1, 2, 3, 4 in the first box and 5, 6, 7, 8 in the second box, row 1 of A is (1, 2) and row 2 of A is (3, 4), while column 1 of B is (5, 7) and column 2 of B is (6, 8). Computing the four inner products gives c₁₁ = 1(5) + 2(7) = 19, c₁₂ = 1(6) + 2(8) = 22, c₂₁ = 3(5) + 4(7) = 43, and c₂₂ = 3(6) + 4(8) = 50, printed as '19 22' on line one and '43 50' on line two.

Worked example 1 illustrating how [1, 2; 3, 4] multiplied by [5, 6; 7, 8] yields [19, 22; 43, 50].
Baseline product AB: [1, 2; 3, 4] × [5, 6; 7, 8] evaluates four dot products to return [19, 22; 43, 50].

Order Reversal & Non-Commutativity Check (5, 6, 7, 8 × 1, 2, 3, 4 → 23 34 / 31 46)

Unlike scalar multiplication where 3 × 5 = 5 × 3, matrix multiplication is not commutative. Swap the two boxes so 5, 6, 7, 8 is the first matrix and 1, 2, 3, 4 is the second matrix. Now row 1 (5, 6) dots with column 1 (1, 3) to give 5(1) + 6(3) = 23, producing '23 34' on line one and '31 46' on line two. Even though AB ≠ BA, notice that the trace tr(AB) = 19 + 50 = 69 equals tr(BA) = 23 + 46 = 69.

Worked example 2 comparing AB = [19, 22; 43, 50] against reversed BA = [23, 34; 31, 46] to demonstrate non-commutativity.
Order matters: reversing the factors to [5, 6; 7, 8] × [1, 2; 3, 4] produces [23, 34; 31, 46] while preserving trace 69.

Verifying an Inverse Matrix (A · A⁻¹ = I₂)

After finding A⁻¹ = [-2, 1; 1.5, -0.5] for A = [1, 2; 3, 4] in the Matrix Inverse Calculator, keep 1, 2, 3, 4 in the first box and paste -2, 1, 1.5, -0.5 into the second box. Selecting Calculate result evaluates 1(-2)+2(1.5) = 1, 1(1)+2(-0.5) = 0, 3(-2)+4(1.5) = 0, and 3(1)+4(-0.5) = 1, returning the 2 × 2 identity matrix '1 0' on line one and '0 1' on line two.

Worked example 3 multiplying [1, 2; 3, 4] by its inverse [-2, 1; 1.5, -0.5] to obtain the identity matrix [1, 0; 0, 1].
Inverse check: multiplying A by A⁻¹ = [-2, 1; 1.5, -0.5] yields the 2×2 identity matrix [1, 0; 0, 1].

How to Read and Verify the Matrix Multiplication Calculator Output

The result panel displays your 2 × 2 product as two lines of space-separated numbers: line one contains c₁₁ and c₁₂, and line two contains c₂₁ and c₂₂.

Each output number is formatted up to 12 significant digits (toPrecision(12)), and IEEE 754 negative zero (-0) is converted to 0. Two algebraic invariants let you double-check any 2 × 2 product in seconds: the determinant product rule det(AB) = det(A)det(B) and the cyclic trace rule tr(AB) = tr(BA).

For the preloaded example, det(A) = 1(4) - 2(3) = -2 and det(B) = 5(8) - 6(7) = -2, so det(AB) must equal (-2)(-2) = 4. Checking the output [19, 22; 43, 50] in the Determinant Calculator confirms 19(50) - 22(43) = 950 - 946 = 4.

Verification diagram illustrating the determinant product rule det(AB) = det(A) * det(B) = (-2) * (-2) = 4.
Determinant invariant check: det([19, 22; 43, 50]) = 950 - 946 = 4, matching det(A) × det(B) = (-2) × (-2).

Matrix Multiplication Calculator Input Rules, Scope & Related Tools

Review the four-entry parsing rules and numeric bounds enforced by the workspace before applying the product matrix to graphics shaders, Markov models, or coursework.

Both First 2 × 2 matrix, row order and Second 2 × 2 matrix, row order call matrix4(), which requires exactly 4 numeric tokens per box. Entering fewer or more than 4 values triggers 'Supply exactly four entries in 2 × 2 row order.' Separate numbers with commas, spaces, or line breaks; standard decimals (0.75), negative values (-1.5), and scientific notation (2.5e3) within ±1,000,000,000 are accepted, whereas fraction slashes (1/2) or brackets ([1, 2]) are rejected.

Chain your linear algebra calculations with our related tools: solve a 2 × 2 linear system Ax = b in the System of Equations Solver, or compute 3D vector inner and outer products in the Dot Product Calculator and Cross Product Calculator.

Input validation rules for the 2x2 Matrix Multiplication Calculator showing four finite entries per matrix within ±10^9.
Input validation: both matrix boxes require exactly 4 real entries in row-major order with magnitude up to 10⁹.

Frequently Asked Questions About Matrix Multiplication Calculator

Answers about using Matrix Multiplication Calculator and understanding its results.

How do you multiply two 2x2 matrices by hand?

Write the first matrix on the left and the second matrix on the right. Multiply across each row of the first matrix and down each column of the second matrix: top-left is a11*b11 + a12*b21, top-right is a11*b12 + a12*b22, bottom-left is a21*b11 + a22*b21, and bottom-right is a21*b12 + a22*b22.

Why does A × B give a different answer than B × A?

Matrix multiplication composes linear transformations in sequence, and row-by-column dot products pair the rows of the left matrix with the columns of the right matrix. When you swap A and B, you pair the rows of B with the columns of A instead, which produces different inner products unless the two matrices commute (such as diagonal matrices or A and its inverse A⁻¹).

When can two matrices with different dimensions be multiplied?

In general linear algebra, an m × n matrix can multiply an r × p matrix if and only if the inner dimensions match (n = r), producing an m × p result. Because this browser tool is built specifically for 2 × 2 square matrices (4 entries per box), the inner dimensions (2 = 2) always match and the product is always 2 × 2.

How do I square a 2x2 matrix (A²) in this calculator?

Paste the exact same four row-order numbers into both First 2 × 2 matrix, row order and Second 2 × 2 matrix, row order, then click Calculate result. Remember that A² = A · A uses row-by-column dot products, not squaring the four entries individually.

How can I multiply larger 3x3 or 4x4 matrices in Excel or a TI-84 calculator?

For 3 × 3 or larger matrices, use the array formula =MMULT(array1, array2) in Excel or Google Sheets, or enter the matrices into [A] and [B] under the [MATRIX] menu on a TI-84 calculator and evaluate [A]*[B] on the home screen.

Calculate result with your input

Choose another tool for your next calculation, conversion, or text task.

Calculate result