Matrices and vectors in the browser
Type a matrix as rows and semicolons and get the determinant, trace, transpose, inverse and product; the vector card takes dot and cross products, magnitude and the angle between them.
Applies to CalcMode matrix and vector calculator, /calculator/matrix-calculator · Updated 2026-11-09
Two tabs share this page: Matrix and Vector. Both read plain text rather than a grid, which is what makes a 4 by 4 matrix as quick to enter as a 2 by 2. Press Calculate to run, unless the link you followed already carried the matrix - a ?a= or ?va= in the address is computed for you on arrival.
The syntax
- Entries in a row are separated by commas, rows by semicolons: 1,2,3;4,5,6;7,8,0 is a 3 by 3 matrix.
- Matrix B is optional - with only A you get determinant, size, transpose, trace and inverse.
- Vectors take up to three components: 2,1,3. A fourth is refused with At most three dimensions.
- Malformed input is named, not guessed: No parsable rows, Empty row, Rows have inconsistent column counts, A cell is not a number.
Matrix results, on the default A = 1,2;3,4
| Row | Value |
|---|---|
| Determinant | -2 |
| Size | 2 × 2 |
| Trace (sum of the diagonal) | 5 |
| Transpose | 1,3 and 2,4 |
| Inverse matrix | -2, 1 / 1.5, -0.5 |
| A × B with B = 5,6;7,8 | 19, 22 / 43, 50 |
The 3 by 3 example 1,2,3;4,5,6;7,8,0 has determinant 27 and trace 6. Switch two rows and the sign flips, which is the fastest check that the number is real: 1,2,3;4,5,6;7,8,0 against 4,5,6;1,2,3;7,8,0 gives -27.
Singular and non-square input
- 1,2;2,4 has determinant 0, so the Inverse matrix row reads None - the determinant is 0. No division by zero, no fake answer.
- A non-square matrix such as 1,2,3;4,5,6 gets only a transpose; determinant and inverse are not computed, and the note says why.
- Multiplying shapes that do not fit gives: The left matrix's column count must equal the right matrix's row count.
- The printed grid is aligned and rounded to four decimals, so an inverse like -1.7777777778 shows as -1.7778.
Vectors
The vector card returns Dimension, Magnitude |a|, Unit vector, Dot product a·b, Cross product a×b and Angle between them. The default pair a = 1,0,0 and b = 0,1,0 shows the whole idea in one screen: magnitude 1, dot product 0, cross product (0, 0, 1), angle 90°. The unit vector of (2,1,3) reads 0.5345, 0.2673, 0.8018 - the same direction scaled to length one.
| a | b | Dot | Cross | Angle |
|---|---|---|---|---|
| 2,1,3 | 1,0,4 | 14 | (4, -5, -1) | 24.8399° |
| 1,2,3 | 4,5,6 | 32 | (-3, 6, -3) | 12.9332° |
| 3,4,0 | 0,0,5 | 0 | (20, -15, 0) | 90° |
Open the tool
These links go straight to the web tool. The ones that carry an example open with it already filled in, so the result appears without typing anything; the rest open the tool ready for your own input.