Matrix calculator
Build a matrix, pick an operation, see the result. Sizes from 1×1 to 5×5; share a link with your matrices baked in.
Operations supported
- A + B and A − B — element-wise. A and B must have the same shape.
- A × B — matrix product. The number of columns in A must equal the number of rows in B; the result is
rows(A) × cols(B). - k · A — multiply every entry of A by a scalar.
- det A — determinant via cofactor expansion. A must be square.
- A⁻¹ — inverse via Gauss-Jordan elimination with partial pivoting. Returns an error if A is singular (a row that reduces to all zeros, or a near-zero pivot).
- Aᵀ — transpose. Rows become columns.
Numerical notes
Values are kept as JavaScript float-64 — fine for any 5×5 matrix with reasonable entries, but be aware that determinants and inverses can lose precision when the matrix is ill-conditioned (a near-zero determinant relative to the entry magnitudes). If you need symbolic exactness over rationals, use a CAS; this calculator is for quick numeric checks.
Sharing
The matrices, scalar and chosen operation are all encoded in the URL. Copy the link and the recipient lands on the exact same problem, ready to be edited.
Frequently asked questions
When can two matrices be multiplied?
The number of columns in the first matrix must equal the number of rows in the second. A 2×3 matrix can multiply with a 3×4 matrix, producing a 2×4 result.
What does the determinant tell you?
The determinant measures how a matrix scales area or volume. A non-zero determinant means the matrix is invertible; zero means it's singular and has no inverse.