Skip to main content

Matrices & linear algebra

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

This calculator performs matrix addition, subtraction, and multiplication on A and B up to 10×10, writing bridge results to Result matrix C with a step-by-step Logic Trace. It also transposes, raises square matrices to a power (n = 0–6), and inverts nonsingular square matrices on A or B directly. Live determinant and trace appear in each panel's Properties row. Scalar modes C = x·A and C = x·B use the × boxes under each matrix. Sizes must match for ±; multiplication requires cols(A)=rows(B)\text{cols}(A)=\text{rows}(B). No symbolic algebra or eigenvalues.

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

Set sizes on the 10×10 grids under Matrix A and Matrix B, enter values or use Fill. Pick a bridge op (+, −, ×, C = x·A, C = x·B, C = B) to populate Result matrix C; use Transpose, Power, or Inv on A or B directly. Read Properties for |A|, |B|, and traces; expand Show step-by-step explanation for Logic Trace.

Reading your matrix result

Bridge ops populate Result C and drive Logic Trace. Transpose, Power, and Inv update A or B in place. Properties holds |A|, |B|, and traces for square matrices.

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

With + selected, Fill → All 1 on A and B. Result C shows four cells at 2.000.

Example: 2×3 · 3×2 multiplication

Resize A to 2×3 and B to 3×2; × enables. Set A to [[1,0,0],[0,1,0]] and B to [[1,2],[3,4],[5,6]] → Result C [[1.000, 2.000], [3.000, 4.000]]. Hover c12 to highlight row 1 of A and column 2 of B.

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

Bridge operations into Result C, unary ops on A/B, live determinant and trace, Logic Trace for each c_ij. Sizes 1×1–10×10; runs locally.

What this calculator does

The widget edits matrices A and B (1×1 through 10×10) and writes bridge results to Result matrix C: addition, subtraction, multiplication, scalar multiply (C = x·A or C = x·B), and copy (C = B). Unary controls on each panel transpose, raise a square matrix to a power (n = 0–6), or replace it with its inverse when det ≠ 0. Square matrices show |A|, |B|, and traces in Properties as you edit. Logic Trace explains every entry of C for bridge ops only.
  • Size rules:
    ± requires matching m×n on A and B; × requires cols(A) = rows(B).

How the math works

Addition and subtraction are element-wise on matching indices. Scalar multiply scales every entry. For AB with A of size m×n and B of size n×p, each ci,j is the dot product of row i of A and column j of B.
ci,j=k=1nai,kbk,jc_{i,j}=\sum_{k=1}^{n} a_{i,k}\,b_{k,j}
Secondary dot-product check (not a form default): row [1, 2, 3] with column [4, 5, 6] gives 1×4 + 2×5 + 3×6 = 32. Transpose swaps indices. Inverse exists when det A ≠ 0 for square A. Power multiplies A by itself n times (n up to 6 on the form).

Limits

Maximum 10×10 per matrix. Cell display uses three decimal places; very small magnitudes use scientific notation in Result C. Logic Trace accordion kicks in beyond 20 lines. No symbolic simplification, eigenvalues, or complex matrix functions. Determinant uses Laplace expansion in code; large integers may show floating-point noise in Properties.

Matrix Calculator FAQ

What does the default layout show?

Both matrices start as 2×2 with + selected on the bridge. With default zeros, Result C is all 0.000. Use Fill → All 1 on A and B to see each ci,j = 2.000 and four Logic Trace lines (c11 through c22).

When are + and − enabled vs ×?

+ and require the same rows and columns on A and B (buttons disable when sizes differ). × requires cols(A) = rows(B); with × selected and a mismatch, Result C shows an amber dimension note. Product size follows (m×n)(n×p)m×p(m\times n)(n\times p)\to m\times p (e.g. 2×3 times 3×2 → 2×2).

Where do determinant, trace, and inverse appear?

For square A or B, |A|, tr(A), and the same for B update live in each panel’s Properties row (shows No data while every cell is zero). Inv replaces the selected matrix with its inverse when det ≠ 0; singular matrices show Matrix is singular (determinant = 0). No inverse. Result C is not used for Inv or Det.

What bridge ops write Result matrix C?

+, , ×, C = x·A, C = x·B, and C = B (copy B into C). Scalars default to 1 in the × boxes under each matrix. Swap exchanges A and B in place; it is separate from C = B.

How does Logic Trace work?

Expand Show step-by-step explanation under Result C. Each row lists ci,j with the numeric formula (+, −, dot product, or scalar). Hover a cell in C to highlight the contributing row of A and column of B (× mode). Traces longer than 20 lines group by result row.

What unary controls apply to A or B directly?

Transpose swaps rows and columns and resizes the panel. Power (n = 0–6, default 2) multiplies a square matrix by itself n times; n = 0 returns the identity. Det is a reminder only; the numeric determinant stays in Properties.

How are cell values rounded and displayed?

Inputs round to 3 decimal places on blur. Result C uses three decimals; values with |v| < 0.001 show in scientific notation (e.g. 1.00e-4). Logic Trace can also show reduced fractions for rational entries.

What is not supported?

Sizes above 10×10, symbolic algebra, eigenvalues, and non-numeric entries. Fractions in cells are decimal only; use the fraction calculator for rational arithmetic separately.

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: July 2026Free Online Utility Tools