SahlCalc سهل
Gulf Hubs:

Saudi Arabia: Labour: HRSD · Tax and zakat: ZATCA

Matrix Calculator

Find the determinant, inverse or transpose of a 2×2 or 3×3 matrix, or multiply, add and subtract two matrices. Type each row on its own line or separate rows with semicolons.

Rows on new lines or split by ;, numbers by spaces, e.g. 1 2; 3 4 (up to 3×3)

A⁻¹

[-2, 1; 1.5, -0.5]

det(A)

-2

Size

2×2

Inverse A⁻¹ (2)
Column 1Column 2
-21
1.5-0.5

Formula with your numbers

  • Determinant ad − bc = 1 × 4 − 2 × 3 = -2
  • Inverse A⁻¹ = 1/det × [d, −b; −c, a] = 1/(-2) × [4, -2; -3, 1]
  • Check A × A⁻¹ = [1, 0; 0, 1]

Quick answer: For A = [1, 2; 3, 4] the determinant is 1 × 4 − 2 × 3 = −2, and the inverse is 1/(−2) × [4, −2; −3, 1] = [−2, 1; 1.5, −0.5].

How it's calculated

Determinant: for a 2×2 matrix [a, b; c, d] it is ad − bc. For a 3×3 matrix it is expanded along the first row: a(ei − fh) − b(di − fg) + c(dh − eg).

Inverse: A⁻¹ = adj(A) ÷ det(A), where the adjugate is the transposed matrix of cofactors. For 2×2 this is 1/(ad − bc) × [d, −b; −c, a]. A matrix whose determinant is 0 is singular and has no inverse. The calculator checks the answer by showing A × A⁻¹, which should be the identity matrix.

Product: entry (i, j) of A × B is row i of A times column j of B, added up, so A needs as many columns as B has rows; in general A × B ≠ B × A. Sums and differences work entry by entry and need matrices of the same size.

Worked examples

  • det [1, 2; 3, 4]: 1 × 4 − 2 × 3 = −2
  • Inverse of [1, 2; 3, 4]: [−2, 1; 1.5, −0.5]
  • [1, 2; 3, 4] × [5, 6; 7, 8]: [19, 22; 43, 50]

Frequently asked questions

How do I type a matrix?

Put each row on a new line, or separate rows with a semicolon, and separate numbers with spaces or commas: "2 0 1; 1 3 2; 1 1 2" is a 3×3 matrix.

Why does my matrix have no inverse?

Its determinant is 0: the rows (or columns) depend on each other, for example one row is a multiple of another.

What is the determinant used for?

It shows whether a system of linear equations has a unique solution (det ≠ 0), and its absolute value is the factor by which the matrix scales areas (2×2) or volumes (3×3).

What is the inverse of [1 2; 3 4]?

[−2 1; 1.5 −0.5]. The determinant is −2, so you swap the diagonal, flip the signs on the other two, and divide everything by −2.

Is A × B the same as B × A?

Almost never. Order matters with matrices, so swapping them usually gives a different answer, or no answer at all if the sizes don't fit.

How do I solve a system of equations with matrices?

Write it as A·x = b. As long as A's determinant isn't zero, x = A⁻¹·b.