CamteX
All tools

LaTeX matrix generator

Set the number of rows and columns, type the values or paste a block of cells from Excel, pick the brackets and copy the code. Matrices up to 10 x 10, with a preview that shows how it will look in the PDF.

Rows
2
Columns
2
Brackets
Preview
A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}
LaTeX code
\[
A = \begin{pmatrix}
1 & 2 \\
3 & 4
\end{pmatrix}
\]

Type numbers or LaTeX expressions, e.g. \frac{1}{2}. Enter moves to the cell below; paste a block of numbers from a spreadsheet into the first cell.

How it works

Matrix bracket types

EnvironmentLooks likeUse it for
pmatrix(abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix}the most common matrix notation
bmatrix[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}square brackets, common in physics and computer science
vmatrix∣abcd∣\begin{vmatrix} a & b \\ c & d \end{vmatrix}a determinant
Vmatrix∥abcd∥\begin{Vmatrix} a & b \\ c & d \end{Vmatrix}a matrix norm
Bmatrix{abcd}\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}curly braces
matrixabcd\begin{matrix} a & b \\ c & d \end{matrix}bare values, e.g. inside your own brackets

Packages you need

\usepackage{amsmath}  % pmatrix, bmatrix, vmatrix

More examples and common mistakes: Matrices in LaTeX: pmatrix, bmatrix, determinant

Other tools

Got formulas on paper?

Draw them or snap a photo and CamteX AI turns them into LaTeX and inserts them into your document.

Try it free