Matrix Subtraction Calculator
Enter the entries of matrices A and B to compute A − B.
Result
How it is calculated
Both matrices are 2×2, with entries named by row and column (a12 is row 1, column 2). The difference C = A − B is built entry by entry: c11 = a11 − b11, c12 = a12 − b12, c21 = a21 − b21, c22 = a22 − b22. The tool then reports two numbers for C: the determinant det = c11·c22 − c12·c21 and the trace trace = c11 + c22. All eight fields must be filled in; a blank field gives no result. Values may be negative or decimal, and everything is shown with two decimals. Order matters: A − B is the negative of B − A.
Worked example
Take A = [5 3; 2 7] and B = [1 4; 6 2]. Subtract position by position: 5 − 1 = 4, 3 − 4 = −1, 2 − 6 = −4, 7 − 2 = 5. The result is [4.00 -1.00; -4.00 5.00], written row by row with a semicolon between rows. Determinant: 4 × 5 − (−1) × (−4) = 20 − 4 = 16.00. Trace: 4 + 5 = 9.00.
Common mistakes
- Swapping the order. A − B and B − A give matrices with opposite signs; the determinant stays the same for 2×2 but the matrix and the trace flip sign.
- Entering a row as a column. The fields are row-major: the second box in the first row is the 1,2 entry, not the 2,1 entry.
- Dropping the minus sign when subtracting a negative. With b12 = −3, a12 − b12 becomes a12 + 3.
- Expecting matrix multiplication rules. Subtraction works entry by entry and needs matching sizes, so there is no row-by-column step here.
- Mixing up the determinant with the trace. The determinant uses the diagonal products minus the off-diagonal products; the trace is just the sum of the two diagonal entries.
About this calculator
Subtracting two matrices of the same size is done element-wise: each entry in the result equals the entry in matrix A minus the entry in the same position in matrix B, so for 2×2 matrices, C₁₁ = A₁₁ − B₁₁, and so on for each of the four positions. It’s one of the most basic operations in linear algebra, alongside addition and scalar multiplication.
Students, engineers, and programmers use matrix subtraction constantly — in computer graphics to find the difference between transformation states, in statistics to compute deviations, and in control systems to measure error between a target and actual state matrix. This calculator subtracts your entered 2×2 matrices B from A and also reports the resulting matrix’s determinant (ad − bc) and trace (sum of the diagonal entries).
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Of the two figures shown for the difference, only the trace behaves simply: trace of A minus B equals trace A minus trace B. The determinant does not. With the default matrices, det A is 31 and det B is minus 10, so subtracting them gives 41, yet the determinant of A minus B is 36. A determinant of zero means the difference cannot be inverted. Do you need larger matrices than 2 by 2?