calc-hub logocalc-hub.net

Matrix Calculator for Rectangular and Square Matrices

Pick an operation, then set the rows and columns of each matrix, from 1 to 6. Rectangular matrices such as 2×3 work. Add and subtract need two matrices of the same shape. Multiply needs as many columns in A as rows in B. Transpose works on any shape of matrix A, and determinant and inverse on a square one. Every cell needs a number, so type 0 for a zero entry.

How to use the Matrix Calculator

  1. Enter your numbers in the Matrix Calculator above.
  2. Press the Calculate button to see the result.
  3. To try other numbers, change any value and press the button again.

Common matrix operations

AB requires cols(A) = rows(B) · · · det(A) for square A · · · A⁻¹ exists iff det(A) ≠ 0 · · · (Aᵀ)ᵢⱼ = Aⱼᵢ

An m×n matrix times an n×p matrix gives an m×p matrix, so a 2×3 times a 3×2 is a 2×2. If the inner numbers differ, the calculator says so and shows no result. Matrix multiplication is not commutative (AB ≠ BA generally). Determinant tests invertibility. Transpose swaps rows and columns. Used in linear algebra, computer graphics, statistics, physics.

Worked example

Matrix A = [[1,2],[3,4]]. det(A) = 1×4 − 2×3 = −2 (non-zero, so invertible). A⁻¹ = (1/det) × [[4,−2],[−3,1]] = [[−2,1],[1.5,−0.5]]. Verify: A × A⁻¹ = identity matrix [[1,0],[0,1]]. A rectangular example: [[1,2,3],[4,5,6]] × [[7,8],[9,10],[11,12]] is a 2×3 times a 3×2, and the result is the 2×2 matrix [[58,64],[139,154]]. The first cell is 1×7 + 2×9 + 3×11 = 58. The transpose of the 2×3 is the 3×2 matrix [[1,4],[2,5],[3,6]].

Frequently asked questions

When is a matrix singular?

When its determinant equals 0. Singular matrices have no inverse and cause systems of linear equations to have either no solution or infinitely many.

Can it handle rectangular matrices or a 4×4?

Yes. Each matrix takes 1 to 6 rows and 1 to 6 columns. Add, subtract, multiply and transpose work on rectangular matrices when the shapes fit. Determinant and inverse need a square matrix, so a 2×3 gets a message. A 4×4, 5×5 or 6×6 determinant or inverse works out exactly, just as a 2×2 does. A 7×7 is too large for this page.

How precise are the results?

Each entry stays an exact fraction of the digits you typed, so a singular matrix is always caught. [[0.1, 0.7], [0.3, 2.1]] has a determinant of exactly 0 and the calculator says it has no inverse. The display then rounds to 4 decimals, or 6 for a determinant, and says so when it did. The inverse of [[3, 0], [0, 3]] shows 0.3333 on the diagonal. Each entry can be 0 or a size from 0.000000000001 to 1,000,000,000,000,000. A result of 1e15 or more, or one too small for its decimals, prints in e-notation with four significant figures, such as 1e+45, and the label says so when that dropped digits. The determinant of [[123456789, 0], [0, 123456789]] shows 1.524e+16, rounded to 4 significant figures.

What does matrix multiplication represent?

Function composition for linear transformations. Multiplying two matrices represents applying one transformation after another. Used in 3D graphics, robotics and quantum mechanics.

How do I solve a system Ax = b?

If A is invertible: x = A⁻¹b. For non-square or singular A, use Gaussian elimination, LU decomposition or least-squares methods.

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.