Matrix Subtraction Calculator
Subtract two matrices of the same size, entry by entry, with the working shown.
Matrix Subtraction Calculator
Calculations use full double precision; this only affects display.
How matrix subtraction works
C = A − B, cij = aij − bijSubtract each entry of B from the entry in the same position of A. Both matrices must have the same number of rows and columns; the result has those dimensions too. Unlike multiplication, the order matters only by sign: A − B = −(B − A).
Your data is processed locally in your browser and is not uploaded to OZVILO servers.
How to use the Matrix Subtraction Calculator
- 1Set the size of matrices A and B and fill them in, paste them as text, or load the examples.
- 2Make sure both have the same number of rows and columns.
- 3Read C = A − B, with the working for every entry.
- 4Copy the result or download it as CSV.
Examples
2 × 3 matrices
- Input
- A = [[5, −2, 3.5], [0, 4, −1]], B = [[1, 3, 0.5], [−2, 4, 6]]
- Result
- A − B = [[4, −5, 3], [2, 0, −7]]
Different sizes
- Input
- A is 2 × 2, B is 2 × 3
- Result
- Explains that the sizes must match
Matrix Subtraction Calculator features
- Matrices up to 8 × 8
- Fractions such as 3/4
- Entry-by-entry working
- Copy and CSV export
Frequently asked questions
How do you subtract matrices?
Subtract the entries in matching positions: (A − B)ᵢⱼ = aᵢⱼ − bᵢⱼ. The result has the same size as A and B.
Can I subtract matrices of different sizes?
No. Subtraction is only defined for matrices with the same number of rows and columns. The tool tells you which dimensions differ.
Is A − B the same as B − A?
No — they're negatives of each other: B − A = −(A − B). Every entry changes sign.
Related tools
- Available
Matrix Transpose Calculator
Transpose a matrix of any shape — rows become columns — with index-by-index working.
CalculatorsOpen tool - Available
QR Decomposition Calculator
Factor a matrix into Q and R with Householder reflections, with rank, error checks and steps.
CalculatorsOpen tool - Available
Orthogonal Projection Calculator
Project a vector onto another vector or onto the column space of a matrix, with the orthogonal component.
CalculatorsOpen tool - Available
Jacobian Matrix Calculator
Find the symbolic Jacobian of a set of functions, evaluate it at a point and get its determinant.
CalculatorsOpen tool