A square matrix is a matrix that has the same number of rows and columns. An n×n matrix is called a square matrix of order n. Square matrices are especially important, as many important and special matrices (such as identity, diagonal, and triangular matrices) are square and they are often used to represent linear transformations.