01What is Matrix Calculator?
Small matrix sums are easy to get wrong by hand. One slipped sign in a row-by-column product and the whole answer is off, and you only find out three steps later. This calculator does three jobs on matrices up to 5×5: A + B, A × B and the transpose Aᵀ. It's meant for checking your work, not for heavy numeric computing. You set Rows and Cols, each from 1 to 5, and two grids appear with that shape: Matrix A and Matrix B. They start filled with A = [[1,2],[3,4]] and B = [[5,6],[7,8]], so you see a real result the moment the page loads. When you grow the grid, the values you already typed stay put and new cells start at 0. Cells take whole numbers, negatives and decimals. A blank cell counts as 0. Anything that isn't a number gets a red outline, and the tool shows a short message instead of a result until you fix it. The maths follows the standard definitions you'd find in any linear algebra textbook. Addition is element by element. Multiplication uses the row-by-column rule, so each result cell is the dot product of one row of A and one column of B. Transpose swaps rows and columns, which turns a 2×3 matrix into a 3×2 one, and it ignores B entirely. Here's a quick worked case. With the starting values, pick A × B. The top-left cell is 1×5 + 2×7 = 19, and the full result is [[19, 22], [43, 50]]. Now swap the grids so A holds the 5-to-8 values. The product becomes [[23, 34], [31, 46]], which shows that order matters. Everything recalculates as you type, so there's no button to press. Results are rounded to 10 significant digits before display. That's why 0.1 + 0.2 shows as 0.3 rather than the 0.30000000000000004 that JavaScript arithmetic actually produces. The numbers you type never leave the page, since all the arithmetic happens in your browser tab. There are honest limits. Both grids always share one shape, so you can't multiply a 2×3 by a 3×4 here. A × B only works when the shape is square, and for anything else the tool explains why rather than printing a wrong answer. It doesn't do determinants, inverses, rank, eigenvalues or row reduction. For determinants, inverses and rank, use our Matrix Determinant Calculator. Very large or very tiny values will also lose digits past the 10 significant ones shown.
Linear algebra students checking homework, and graphics or game programmers who want to confirm a small transform product before it goes into code. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Matrix Calculator
- Set Rows and Cols (1 to 5 each). Values you already typed are kept when you resize.
- Pick the operation: A + B, A × B or Aᵀ.
- Type values into Matrix A, and into Matrix B for addition or multiplication. Blank cells count as 0.
- Read the Result grid and its size label, which update as you type.
- If a red outline or a message appears, fix the flagged cell or make the shape square for A × B.
03Worked examples
- Input:
A = [[1, 2], [3, 4]], B = [[5, 6], [7, 8]], operation A + B - Result:
[[6, 8], [10, 12]] - Element by element: each cell is A[i][j] + B[i][j].
- Input:
A = [[1, 2], [3, 4]], B = [[5, 6], [7, 8]], operation A × B - Result:
[[19, 22], [43, 50]] - Each cell is a row of A times a column of B, e.g. 1×5 + 2×7 = 19.
- Input:
A = [[5, 6], [7, 8]], B = [[1, 2], [3, 4]], operation A × B - Result:
[[23, 34], [31, 46]] - Swapping the matrices changes the product. Matrix multiplication isn't commutative.
- Input:
A = [[0, -1], [1, 0]] (90° rotation), B = [[2, 0], [0, 3]] (scale), operation A × B - Result:
[[0, -3], [2, 0]] - Rotation times scale. Reverse the order and you get a different matrix.
- Input:
A = [[1, 2, 3], [4, 5, 6]] (2×3), operation Aᵀ - Result:
[[1, 4], [2, 5], [3, 6]] (3×2) - Input:
A = [[0.1, (blank)], [1.5, 2]], B = [[0.2, 3], [1, 1]], operation A + B - Result:
[[0.3, 3], [2.5, 3]] - A blank cell counts as 0, and results are rounded to 10 significant digits so 0.1 + 0.2 shows as 0.3.
04Common use cases
- Checking a hand-worked 3×3 product from a linear algebra problem set before you hand it in
- Composing a 2D rotation matrix with a scale matrix for canvas or game code and confirming the combined transform
- Showing a class that A × B and B × A differ by swapping the two grids
- Transposing a small weight matrix or data table while debugging a shape mismatch
- Confirming that multiplying by the identity matrix returns the original matrix in a unit test fixture
- Adding two small adjacency or count matrices from a graph exercise
05Tips
- For A × B here you need Rows equal to Cols, because both grids share one shape. A 2×3 grid will show a message, not a product.
- To check the order of a transform chain, put the identity in B first. A × I should give you A back exactly.
- The transpose of a product reverses the order: (AB)ᵀ = BᵀAᵀ. Compute both sides here in a few passes to see it.
- Results show at most 10 significant digits, so very long decimals are rounded for display. Keep that in mind when comparing to float64 output from code.
06Related concepts
Linear algebra, Matrix multiplication, Transpose, Dot product, Identity matrix.
Frequently Asked Questions
What is Matrix Calculator?
Matrix Calculator is a free, browser-based developer tool on AIDToolStack. Add, multiply and transpose matrices up to 5x5. It requires no installation or sign-up and works entirely in your browser.
Is Matrix Calculator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Matrix Calculator store my data?
No. It runs in your browser; nothing is uploaded.