Skip to main content

Matrices & linear algebra

Matrix Calculator: Add, Subtract, Multiply, Inverse & Determinant

This calculator works with matrices A and B up to 10×10. Bridge operations write addition, subtraction, multiplication, scalar multiples, or a copy into Result matrix C, with a step-by-step Logic Trace under the result. On each panel you can transpose, raise a square matrix to a power (n = 0–6), or invert a nonsingular square matrix. Live determinant and trace appear in Properties. For ± the sizes must match; for multiplication you need cols(A)=rows(B)\text{cols}(A)=\text{rows}(B). There is no symbolic algebra or eigenvalue solver.

By Jeff Beem

Updated

Matrix A

2×2

Size

Scalar Operations
Properties:|A| = No data·tr(A) = No data

Matrix B

2×2

Size

Scalar Operations
Properties:|B| = No data·tr(B) = No data
Result Matrix C
0.000
0.000
0.000
0.000

How to use this calculator

Start with the size grids under Matrix A and Matrix B. Click until each panel has the rows and columns you need, then type values or use Fill (zeros, ones, or random numbers).

Choose a bridge operation in the middle (+, −, ×, or one of the C = … options) to send the answer into Result matrix C. Addition and subtraction need matching sizes; multiplication needs the columns of A to match the rows of B. For work on a single matrix, use Transpose, Power, or Inv on that panel instead.

Read Properties for determinants and traces when a matrix is square. Under C, expand Show step-by-step explanation if you want Logic Trace to walk through each entry. Everything here is local arithmetic for learning, not a computer-algebra system.

Reading your matrix result

Bridge operations send answers into Result C and feed Logic Trace. Transpose, Power, and Inv change A or B in place. For square matrices, Properties holds the determinant and trace while you type.

Example: default 2×2 addition after Fill → All 1

The calculator opens as two 2×2 matrices of zeros with + selected. Choose Fill → All 1 on both A and B. Result C then shows four cells at 2.000, one for each matching pair. Expand Logic Trace if you want to see each sum written out.

Example: 2×3 · 3×2 multiplication

Resize A to 2×3 and B to 3×2 so × enables. Enter A as [[1, 0, 0], [0, 1, 0]] and B as [[1, 2], [3, 4], [5, 6]]. Result C becomes [[1.000, 2.000], [3.000, 4.000]]. Hover c12 to highlight row 1 of A and column 2 of B in the panels above.

When + stays disabled

On this calculator, if the size grids under Matrix A and Matrix B do not match, the bridge + and − buttons stay off on purpose. Match the dimensions first, or switch to × when cols(A) equals rows(B). An amber note under Result matrix C appears when multiplication dimensions are wrong.

Matrix calculator: add, subtract, multiply, inverse, and determinant

This calculator runs bridge operations into Result C, unary ops on A or B, live determinant and trace, and a Logic Trace for each entry of C. Matrix sizes run from 1×1 to 10×10. Everything runs locally in your browser.

What this calculator does

This calculator lets you edit Matrix A and Matrix B (from 1×1 through 10×10) and send bridge results into Result matrix C: addition, subtraction, multiplication, scalar multiply (C = x·A or C = x·B), and copy (C = B). On each panel you can also transpose, raise a square matrix to a power (n from 0 to 6), or replace it with its inverse when the determinant is not zero. Square matrices show |A|, |B|, and traces in Properties as you type. Logic Trace under Result C explains every entry for bridge ops only. By default both panels open as 2×2 zeros with + selected.
  • Size rules:
    Addition and subtraction need matching m×n on A and B. Multiplication needs cols(A) = rows(B).

How the math works

On this page, addition and subtraction work entry by entry on matching indices. Scalar multiply scales every entry by the same number. For a product AB where A is m×n and B is n×p, each ci,j is the dot product of row i of A with column j of B. The widget shows that product in Result C when × is selected and the sizes line up.
ci,j=∑k=1nai,k bk,jc_{i,j}=\sum_{k=1}^{n} a_{i,k}\,b_{k,j}
A quick check that is not a form default: the row [1, 2, 3] dotted with the column [4, 5, 6] is 1×4 + 2×5 + 3×6 = 32. Transpose swaps indices. An inverse exists only when det A ≠ 0 for a square matrix A. Power multiplies A by itself n times (n up to 6 on the form).

Limits

Each matrix on this tool tops out at 10×10. Cells display three decimal places; very small magnitudes in Result C switch to scientific notation. Logic Trace groups long lists once you pass about 20 lines. The calculator does not do symbolic simplification, eigenvalues, or a full complex matrix toolbox. Determinants use Laplace expansion in code, so large integers can show a little floating-point noise in Properties.

Matrix Calculator FAQ

What does the default layout show?

Both panels open as 2×2 matrices filled with zeros, and the bridge starts on +. With those defaults, every cell in Result C is 0.000. Use Fill → All 1 on A and B when you want a quick check: each entry in C becomes 2.000, and Logic Trace lists four lines for c11 through c22.

When are + and − enabled vs ×?

+ and − only work when A and B share the same number of rows and columns. The buttons disable when the sizes differ. × needs cols(A) equal to rows(B). If you select × with a mismatch, Result C shows an amber dimension note instead of numbers. A valid product has size (m×n)(n×p)→m×p(m\times n)(n\times p)\to m\times p. For example, a 2×3 matrix times a 3×2 matrix yields a 2×2 result.

Where do determinant, trace, and inverse appear?

When A or B is square, that panel’s Properties row shows |A| or |B| and the matching trace as you edit. While every cell is still zero, the row reads No data. Inv replaces the selected matrix with its inverse when the determinant is not zero. If the matrix is singular, you see Matrix is singular (determinant = 0). No inverse. Inverse and Det act on A or B; they do not write into Result C.

What bridge ops write Result matrix C?

These bridge choices fill C: +, −, ×, C = x·A, C = x·B, and C = B (copy B into C). The scalar × boxes under each matrix default to 1. Swap exchanges A and B in place; that is separate from C = B.

How does Logic Trace work?

Expand Show step-by-step explanation under Result C. Each row names a ci,j and shows the numeric formula behind it (sum, difference, dot product, or scalar). In × mode, hover a cell in C to highlight the row of A and the column of B that produced it. If the trace grows past 20 lines, the list groups by result row so it stays readable.

What unary controls apply to A or B directly?

Transpose swaps rows and columns and resizes that panel. Power (n from 0 to 6, default 2) multiplies a square matrix by itself n times; n = 0 returns the identity. Det is a reminder label; the live determinant lives in Properties.

How are cell values rounded and displayed?

Inputs round to 3 decimal places when you leave a cell. Result C also uses three decimals. Values with absolute value under 0.001 switch to scientific notation (for example 1.00e-4). Logic Trace can show reduced fractions when the entries are rational.

What is not supported?

Matrices larger than 10×10, symbolic algebra, eigenvalues, and non-numeric entries are out of scope. Cells are decimal only. For rational arithmetic on its own, use the fraction calculator.

Mathematical Reference Note

Calculation Logic: This tool uses standard mathematical algorithms. While we strive for accuracy, errors in logic or user input can result in incorrect data.

Verification: Results should be cross-checked if used for important academic, professional, or personal calculations.

Standard Terms: This tool is provided free of charge and as-is. CalcRegistry provides no warranty regarding the accuracy or fitness of these results for your specific needs.

© 2026 CalcRegistry Reference Last System Check: October 2026Free Online Utility Tools