BYTETOOLS

Matrix Calculator

Add, subtract and multiply matrices up to 6×6, transpose them or scale by a number. Type matrices as simple rows and get instant, copyable results.

Result: A + B (2×2)

68
1012

What is the Matrix Calculator?

The ByteTools Matrix Calculator performs the core matrix operations: addition, subtraction, matrix multiplication, scalar multiplication and transposition, for matrices up to 6×6.

  • Addition, subtraction and full matrix multiplication
  • Transpose and scalar multiplication
  • Matrices up to 6×6, entered as simple text rows
  • Clear dimension checks with helpful error messages
  • Copyable monospace result grid
  • 100% private — nothing leaves your browser

How to use the Matrix Calculator

  1. 1

    Type matrix A: one row per line, numbers separated by spaces or commas.

  2. 2

    Pick an operation — add, subtract, multiply, transpose or scalar multiply.

  3. 3

    Enter matrix B (or the scalar) if the operation needs it.

  4. 4

    Read the result grid and any dimension warnings.

  5. 5

    Copy the result matrix with one click.

About the Matrix Calculator

The ByteTools Matrix Calculator performs the core matrix operations: addition, subtraction, matrix multiplication, scalar multiplication and transposition, for matrices up to 6×6. Type each matrix as plain rows of numbers — one row per line, values separated by spaces or commas — and the result appears instantly in a clean monospace grid.

It is built for linear algebra students checking homework, engineers working with transformation matrices, and programmers verifying hand computations. The calculator checks dimensions before every operation and explains exactly why an operation is impossible, for example when the inner dimensions do not match for multiplication.

All arithmetic is plain JavaScript running 100% locally in your browser. Your matrices are never uploaded or stored, results can be copied with one click, and the tool keeps working offline.

Frequently asked questions

How do you multiply two matrices?

Each entry of the product is the dot product of a row of the first matrix with a column of the second. The number of columns in the first matrix must equal the number of rows in the second, so a 2×3 times a 3×4 gives a 2×4 result. The calculator checks this automatically.

Why can't I add matrices of different sizes?

Matrix addition works entry by entry, so both matrices must have exactly the same number of rows and columns. Adding a 2×3 matrix to a 3×2 matrix is undefined. The tool tells you the exact dimensions it found so you can fix the input.

Is matrix multiplication commutative?

No. In general A×B is not equal to B×A — the shapes may not even be compatible both ways, and even for square matrices the results usually differ. This calculator multiplies in the order you choose, and you can swap the matrices to compare.

What is the transpose of a matrix?

The transpose flips a matrix over its main diagonal: rows become columns and columns become rows, so an m×n matrix becomes n×m. The entry at row i, column j moves to row j, column i. It is written Aᵀ.

How do I enter a matrix into this calculator?

Type one row per line and separate the numbers in a row with spaces or commas. For example, a 2×2 identity matrix is entered as "1 0" on the first line and "0 1" on the second. Decimals and negative numbers are fine.

Related tools