Free Online Matrix Calculator with Steps
Build Matrices and Choose an Operation
Enter your values, then choose an operation from the menu between the matrices.
Matrix A
Matrix B
The result already updates live. This button takes you directly to the complete result and steps.
—
Calculation steps
How the result above was reached.
About This Free Online Matrix Calculator
Toolslight’s free online matrix calculator provides instant, step-by-step solutions for fundamental and advanced matrix operations. Whether you are balancing linear algebra coursework, preparing engineering models, or checking homework exercises, this tool acts as an all-in-one matrix solver. You can construct Matrix A and Matrix B with customized dimensions up to 6×6, perform operations such as addition, subtraction, matrix multiplication, scalar scaling, transpose, determinant, inverse, and trace, and see the mathematical steps unfold in real time.
Quickly configure it as a 2x2 matrix calculator or 3x3 matrix calculator for standard textbook problems, or scale up to rectangular matrices (such as 2×3 or 3×2) whenever dimension compatibility allows. You can enter positive integers, negative values, and decimals (using a standard decimal point). The calculator processes empty inputs as zero and computes answers rounded to four decimal places.
Comprehensive Matrix Solver for Students & Educators
Designed with academic clarity at its core, this matrix calculator with steps bridges the gap between raw numeric calculation and theoretical understanding. Instead of simply delivering a final matrix, the tool reveals the underlying algebraic methodology:
- Step-by-step matrix multiplication: Inspect individual row-by-column dot products to understand how each cell value is assembled.
- Determinant calculation: Follow 2×2 diagonal cross-multiplication (
ad − bc) or 3×3 expansion by minors along the first row. - Invertible matrix verification: Automatically check whether a matrix is singular (
det(A) = 0) and view the adjugate cofactor matrix method used to computeA⁻¹. - Educational utility: Ideal for high school algebra, A-Level / Further Maths, college linear algebra courses, and computer science graphics algorithms.
What Is a Matrix and Where Is It Used?
In mathematics and linear algebra, a matrix is a rectangular array of numbers arranged in rows and columns. Dimensions are conventionally denoted as m × n, representing m rows and n columns. When m = n, the matrix is square. Matrices serve as the mathematical foundation for modern computer graphics (transforming 3D coordinates, rotations, and scaling), neural networks and machine learning (weight tensors and vector embeddings), physics simulations (stress tensors and quantum mechanics state vectors), and economics (input-output modeling).
How to Use the Matrix Calculator
1. Configure Dimensions: Use the row and column steppers to adjust dimensions from 1×1 up to 6×6. Set both to 2 or 3 for 2×2 or 3×3 matrix operations.
2. Enter Entries or Use Presets: Type your values directly into the input cells. Use the Zero preset to reset cells, Identity to generate an identity matrix with ones along the main diagonal, or Random to populate test integers.
3. Select Operation: Click the operation menu button between Matrix A and Matrix B. Binary operations (Add, Subtract, Multiply) combine both matrices. Unary operations (Scalar, Transpose, Determinant, Inverse, Trace) allow you to apply the calculation to Matrix A or Matrix B via the Apply to toggle.
4. View Results & Working Steps: The result updates automatically as you type. Click Evaluate Matrix to smoothly scroll to the solution. Expand or collapse the Calculation steps card to examine the formulas, dot products, or minor expansions.
5. Export & Share: Select your preferred output format (Plain text, CSV, or LaTeX) and click Copy result. You can also click Download image for a presentation-ready PNG or Download PDF for study notes.
Matrix Operations with Step-by-Step Working
Our online matrix calculator supports eight primary linear algebra operations, each complete with dimension validation and detailed solution steps:
Matrix Addition & Subtraction Calculator
Element-wise addition and subtraction add or subtract corresponding entries: Cij = Aij ± Bij. Both matrices must share identical dimensions. The calculator displays every individual entry calculation step for up to 12 cells.
A = [1, 2; 3, 4], B = [5, 6; 7, 8]
A + B = [1+5, 2+6; 3+7, 4+8] = [6, 8; 10, 12]
A − B = [1−5, 2−6; 3−7, 4−8] = [−4, −4; −4, −4]
Matrix Multiplication Calculator
Matrix multiplication computes row-by-column dot products. The columns of Matrix A must equal the rows of Matrix B (an m × k matrix multiplied by a k × n matrix produces an m × n matrix). Each dot product calculation is clearly detailed.
Formula & 2x2 Example:A = [1, 2; 3, 4], B = [5, 6; 7, 8]
C₁₁ = (1×5) + (2×7) = 5 + 14 = 19
A × B = [19, 22; 43, 50]
Matrix Determinant Calculator
The determinant is a scalar value calculated exclusively from square matrices. For a 2×2 matrix, det(A) = ad − bc. For 3×3 matrices, the calculator expands along the first row with sub-minors. A determinant of zero indicates a singular, non-invertible matrix.
A = [a, b, c; d, e, f; g, h, i]
det(A) = a(ei − fh) − b(di − fg) + c(dh − eg)
Matrix Inverse Calculator
The inverse matrix satisfies A × A⁻¹ = I, where I is the identity matrix. It is only defined for square matrices with a non-zero determinant. For a 2×2 matrix, A⁻¹ = (1/det(A)) × [d, −b; −c, a]. For 3×3 and larger matrices, the adjugate cofactor method is utilized.
If det(A) = 0, the matrix is singular and no inverse exists. The tool displays a clear mathematical notice if a matrix is non-invertible.
Matrix Transpose Calculator
The transpose operator flips a matrix over its main diagonal, turning row vectors into column vectors (entry (i, j) moves to position (j, i)). An m × n matrix becomes an n × m matrix. Any square or rectangular matrix can be transposed.
A = [1, 2, 3; 4, 5, 6]
Aᵀ = [1, 4; 2, 5; 3, 6]
Matrix Trace & Scalar Multiplication
The matrix trace sums the entries along the main diagonal of a square matrix: tr(A) = Σ Aii. For [4, 2; 3, 5], tr(A) = 4 + 5 = 9.
The scalar multiplication calculator scales every entry of a matrix by a constant factor k: (kA)ij = k × Aij. For k = 2 and A = [1, 2; 3, 4], 2A = [2, 4; 6, 8].
Step-by-Step Matrix Calculation Examples
Review these concrete, worked examples to understand how our matrix solver breaks down algebraic operations step by step.
Example 1: 2x2 Determinant with Steps
Problem Matrix: A = [4, 2; 3, 5]
Step 1 (Formula): det(A) = (a × d) − (b × c)
Step 2 (Substitute): (4 × 5) − (2 × 3)
Step 3 (Multiply): 20 − 6
Step 4 (Final Answer): det(A) = 14
Because det(A) ≠ 0, Matrix A is invertible. Its inverse is A⁻¹ = (1/14) × [5, −2; −3, 4].
Example 2: 2x2 Matrix Multiplication with Steps
A = [1, 2; 3, 4] and B = [5, 6; 7, 8]
Step 1 (Dimensions): Both are 2×2, inner dimensions match (2 = 2), output is 2×2.
Step 2 (Row 1 × Col 1): (1×5) + (2×7) = 5 + 14 = 19
Step 3 (Row 1 × Col 2): (1×6) + (2×8) = 6 + 16 = 22
Step 4 (Row 2 × Col 1): (3×5) + (4×7) = 15 + 28 = 43
Step 5 (Row 2 × Col 2): (3×6) + (4×8) = 18 + 32 = 50
Result: A × B = [19, 22; 43, 50]
Matrix Dimension Compatibility Rules
Before computing, ensure your matrices satisfy the formal linear algebra dimensional constraints:
- Addition & Subtraction: Requires identical dimensions (
m × n±m × n). You cannot add a 2×3 matrix to a 3×2 matrix. - Matrix Multiplication: The number of columns in the first matrix must equal the number of rows in the second (
m × kmultiplied byk × nyieldsm × n). Note that matrix multiplication is not commutative (A × B ≠ B × Ain general). - Determinant, Inverse & Trace: Strict square matrix requirement (
n × n). Additionally, the inverse requires a non-zero determinant (det(A) ≠ 0). - Transpose & Scalar: Universal applicability across any rectangular or square dimensions (
1×1up to6×6).
100% Free & Private: No Login or Account Required
This free matrix calculator executes all calculations locally on your device using client-side JavaScript. Your numeric entries, matrices, and calculation history are never uploaded to a server or stored remotely. Use it freely for private study, commercial work, or academic homework without creating an account or signing in.
Frequently Asked Questions FAQs
What is a matrix calculator with steps?
A matrix calculator with steps calculates a matrix operation and explains the method used to reach the answer. Toolslight supports addition, subtraction, multiplication, scalar multiplication, transpose, determinant, inverse and trace. Enter your numbers, choose an operation and review the result and working below the matrix grids.
How do I multiply matrices step by step?
Enter Matrix A and Matrix B, then select Multiply. The columns in A must match the rows in B. For each answer, multiply matching entries from a row of A and a column of B, then add the products. For example, the row [1, 2] multiplied by the column [5, 7] gives 1 × 5 + 2 × 7 = 19. The matrix multiplication calculator shows each dot product when the result has nine entries or fewer.
Can I use this as a 2x2 or 3x3 matrix calculator?
Yes. Set Rows and Cols to 2 for a 2x2 matrix or to 3 for a 3x3 matrix, enter your values and choose an operation. The controls allow one to six rows and columns, including rectangular matrices. Addition and subtraction need matching dimensions; determinant, inverse and trace need a square matrix. An inverse also requires a non-zero determinant.
How do I find the inverse of a 2x2 or 3x3 matrix?
Enter a square matrix, select Inverse and use Apply to to choose Matrix A or Matrix B. For a 2x2 matrix [a, b; c, d], the inverse is [d, −b; −c, a] divided by ad − bc. For a 3x3 matrix, this inverse matrix calculator uses the adjugate, which is the transpose of the cofactor matrix, divided by the determinant. A zero determinant means no inverse exists. The working outlines these steps; it does not expand every 3x3 cofactor calculation.
How do I calculate a 2x2 or 3x3 determinant?
Select Determinant and choose Matrix A or Matrix B under Apply to. For a 2x2 matrix [a, b; c, d], calculate ad − bc. For a 3x3 matrix [a, b, c; d, e, f; g, h, i], calculate a(ei − fh) − b(di − fg) + c(dh − eg). The determinant calculator shows the 2x2 substitution or the 3x3 first-row expansion, minor values and final answer.
Can I multiply two matrices of different sizes?
Yes, if their inner dimensions match. An m × n matrix multiplied by an n × p matrix produces an m × p matrix. For example, a 2x3 matrix can multiply a 3x2 matrix to give a 2x2 result. Order matters: A × B and B × A can have different sizes or values, and one product may be undefined.
What is the difference between a matrix transpose and inverse?
A transpose swaps rows and columns, so a 2x3 matrix becomes a 3x2 matrix. An inverse is a matrix that gives the identity matrix when multiplied by the original. Every matrix has a transpose, but only a square matrix with a non-zero determinant has an inverse. Choose Transpose to swap rows and columns or Inverse to calculate A⁻¹.
Does this matrix calculator show work for every matrix size?
It displays both the answer and calculation steps. Multiplication shows each row-by-column calculation for results with up to nine entries. Addition, subtraction and scalar multiplication show each entry calculation for matrices with up to 12 entries. Larger calculations show the method and result, while inverse calculations outline the formula or adjugate method. Displayed values are rounded to up to four decimal places, so use the working to check the method rather than treating every displayed decimal as exact.
Is this free online matrix calculator private?
Yes. The calculator is free and requires no account, login or matrix upload. Matrix entries and calculations are processed locally in your browser. You can copy the result or download an image or PDF when you want to save your work.
Can I enter decimals, negative numbers or fractions?
You can enter whole numbers, negative numbers and decimals, using a dot as the decimal separator. Convert fractions to decimals before entering them; for example, enter 0.5 for 1/2. Fraction expressions such as 1/2, symbolic variables and complex numbers are not supported. Empty cells are treated as zero.
Explore Related Calculators
Complement your linear algebra and math calculations with these tools:
- Calculate your credit-weighted semester or cumulative grades and academic goals with our CGPA calculator.
- Perform advanced scientific, trigonometric, and logarithmic calculations with our scientific calculator.
- Solve proportions, percentage increase, and decrease calculations with our percentage calculator.