Free Matrix Rank Calculator

Matrix Dimensions

Matrix Values

 
Col 1
Col 2
Row 1
Row 2

Results

Select matrix dimensions and enter values to calculate the rank.

The rank of a matrix is a cornerstone concept in linear algebra, quantifying the maximum number of linearly independent rows (or columns) within the matrix. Unlike the determinant, which is restricted to square arrays, the rank applies to any rectangular shape and provides insight into the dimension of the space spanned by the matrix’s rows or columns. A matrix whose rows are all independent is called full rank, a property that underpins many applications—solving systems of equations, computing transformations, and analyzing data structure. With a dedicated matrix rank calculator, you can swiftly determine this value without wading through manual arithmetic. This free linear algebra rank calculator employs Gaussian elimination, the most straightforward algorithm to find rank of matrix, ensuring accurate results for matrices of any size.

什么是矩阵秩?

Formally, the rank of an m×nm \times n matrix AA is defined as the largest number of linearly independent rows (or columns) in AA. Equivalently, it is the dimension of the row space (the subspace spanned by the rows) or the column space (spanned by the columns). Linear independence means that no row (or column) can be expressed as a linear combination of the others.

To illustrate, consider two vectors in the plane: v1=(1,0)\mathbf{v}_1 = (1,0) and v2=(0,1)\mathbf{v}_2 = (0,1). They are independent because the only solution to c1v1+c2v2=0c_1\mathbf{v}_1 + c_2\mathbf{v}_2 = \mathbf{0} is c1=c2=0c_1 = c_2 = 0. A third vector v3=(2,3)\mathbf{v}_3 = (2,3) is a linear combination: 2v1+3v22\mathbf{v}_1 + 3\mathbf{v}_2. If a matrix contains rows corresponding to v1\mathbf{v}_1 and v2\mathbf{v}_2, its rank is 2; adding a row equal to v3\mathbf{v}_3 does not increase the rank because the new row is dependent. Thus, rank captures the number of “essential” dimensions present.

A matrix achieves full rank when its rank equals min⁡(m,n)\min(m,n), the maximum possible given its dimensions. For a square matrix of order nn, full rank implies a non‑zero determinant and the existence of an inverse. For rectangular matrices, full rank indicates that the rows (if m≤nm \le n) or columns (if n≤mn \le m) span the entire space of appropriate dimension.

用高斯消元法计算秩

The most reliable way to compute the rank manually is Gaussian elimination (also called Gauss‑Jordan elimination when continued to reduced row echelon form). The method relies on three elementary row operations:

  • Swap two rows.
  • Multiply a row by a non‑zero constant.
  • Add a multiple of one row to another.

These operations are called elementary because they do not change the row space of the matrix, and consequently they preserve the rank. By applying them systematically, we transform the matrix into row echelon form (REF), where each pivot (the first non‑zero entry in a row) lies to the right of the pivot in the previous row, and all entries below a pivot are zero. Once the matrix is in REF, the number of non‑zero rows equals the original rank. This is true because each non‑zero row corresponds to a pivot, and pivots indicate linearly independent rows that cannot be eliminated by the rows above.

Thus, the Gaussian elimination rank detection method is both simple and rigorous. The matrix rank calculator on this page implements exactly this algorithm, performing the operations automatically and returning the rank in seconds.

秩的基本性质

A few essential facts about rank are worth noting:

  • For an m×nm \times n matrix, rank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m, n). Full rank occurs when equality holds.
  • The rank of a matrix equals the rank of its transpose: rank⁡(A)=rank⁡(A⊤)\operatorname{rank}(A) = \operatorname{rank}(A^\top).
  • For square matrices, full rank is equivalent to a non‑zero determinant and invertibility.
  • The rank of a product of matrices satisfies rank⁡(AB)≤min⁡(rank⁡(A),rank⁡(B))\operatorname{rank}(AB) \le \min(\operatorname{rank}(A), \operatorname{rank}(B)).
  • Rank‑nullity theorem: If AA is an m×nm \times n matrix, rank⁡(A)+nullity⁡(A)=n\operatorname{rank}(A) + \operatorname{nullity}(A) = n, where the nullity is the dimension of the null space (solutions to Ax=0A\mathbf{x} = \mathbf{0}).

These properties help in analyzing matrices without a full row reduction.

秩与线性方程组

The rank directly determines the solvability of a linear system Ax=bA\mathbf{x} = \mathbf{b}. The system is consistent if and only if rank⁡(A)=rank⁡([A∣b])\operatorname{rank}(A) = \operatorname{rank}([A \mid \mathbf{b}]). If the rank equals the number of unknowns, the solution is unique. In underdetermined systems (fewer equations than unknowns), the dimension of the solution space equals n−rank⁡(A)n - \operatorname{rank}(A), i.e., the nullity.

数值示例一:一个简单的依赖矩阵

Let us compute the rank of

B=(122436).B = \begin{pmatrix} 1 & 2\\ 2 & 4\\ 3 & 6 \end{pmatrix}.

Notice that row 2 is twice row 1, and row 3 is three times row 1. Hence, only one row is independent. Applying Gaussian elimination:

  • R2←R2−2R1R_2 \leftarrow R_2 - 2R_1 yields (0,0)(0,0).
  • R3←R3−3R1R_3 \leftarrow R_3 - 3R_1 yields (0,0)(0,0).

The row echelon form is

(120000),\begin{pmatrix} 1 & 2\\ 0 & 0\\ 0 & 0 \end{pmatrix},

which has one non‑zero row, so rank⁡(B)=1\operatorname{rank}(B) = 1. This matches our expectation: the rank cannot exceed the number of columns (2), and here it is less because of perfect linear dependence.

数值示例二:一个 4×3 矩阵的完整化简

Now we tackle a more interesting example:

A=(013124248128).A = \begin{pmatrix} 0 & 1 & 3\\ 1 & 2 & 4\\ 2 & 4 & 8\\ 1 & 2 & 8 \end{pmatrix}.

We will apply row reduction to find its rank.

Step 1 – Swap: Because the top‑left element is zero, we exchange row 1 with row 2 to obtain a non‑zero pivot in the first column:

(124013248128).\begin{pmatrix} 1 & 2 & 4\\ 0 & 1 & 3\\ 2 & 4 & 8\\ 1 & 2 & 8 \end{pmatrix}.

Step 2 – Eliminate first column: Use the pivot in row 1 to zero out the entries below it in column 1:

  • R3←R3−2R1R_3 \leftarrow R_3 - 2R_1 produces row 3: [0,0,0][0,0,0].
  • R4←R4−1R1R_4 \leftarrow R_4 - 1R_1 produces row 4: [0,0,4][0,0,4].

The matrix becomes

(124013000004).\begin{pmatrix} 1 & 2 & 4\\ 0 & 1 & 3\\ 0 & 0 & 0\\ 0 & 0 & 4 \end{pmatrix}.

Step 3 – Look for next pivot: Column 2 already contains a pivot in row 2. Below it there are zeros, so no action is needed in column 2. Move to column 3. There is a non‑zero entry at row 4, column 3 (value 4), but row 3 is zero. Swap rows 3 and 4 to bring the non‑zero row up:

(124013004000).\begin{pmatrix} 1 & 2 & 4\\ 0 & 1 & 3\\ 0 & 0 & 4\\ 0 & 0 & 0 \end{pmatrix}.

Now the matrix is in row echelon form. Rows 1, 2, and 3 contain pivots (in columns 1, 2, and 3 respectively), while row 4 is all zero. Thus, there are three non‑zero rows, so rank⁡(A)=3\operatorname{rank}(A) = 3. Observe that min⁡(4,3)=3\min(4,3) = 3, so this is a full‑rank matrix (its columns are linearly independent, even though it has more rows than columns.)

This step‑by‑step process demonstrates how row reduction preserves the rank and how the final count of non‑zero rows gives the answer.

使用矩阵秩计算器

While manual row reduction builds understanding, it can be time‑consuming for large or many matrices. The matrix rank calculator featured here eliminates the tedium: simply enter the dimensions, fill the entries, and instantly get the rank. The underlying algorithm performs Gaussian elimination in real time, handling both real and complex entries. This free linear algebra rank calculator is an ideal companion for students, engineers, and data analysts who frequently need to find rank of matrix.

结语

Understanding the rank of a matrix is a gateway to deeper linear algebra—it reveals the true dimensionality of data, dictates the solvability of equations, and guides model selection in multivariate analysis. With the matrix rank calculator, you can obtain this crucial number quickly and accurately, allowing you to focus on interpretation rather than calculation. Try it now for any matrix that comes your way.

FAQ

1. How can I quickly find the rank of a matrix?

You can use the matrix rank calculator on this page: enter the number of rows and columns, fill the entries, and the tool instantly returns the rank using Gaussian elimination.

2. What does it mean when a matrix has full rank?

A full rank matrix has a rank equal to the smaller of its row and column dimensions. This means all rows (or columns) are linearly independent. For a square matrix, full rank implies a non‑zero determinant and invertibility.

3. Why does row reduction preserve the rank?

Elementary row operations do not change the row space of the matrix, so the rank remains unchanged. When the matrix is reduced to row echelon form, the number of non‑zero rows equals the original rank because each non‑zero row corresponds to an independent pivot row.

4. What is the relationship between rank and linear system solvability?

The linear system Ax = b is consistent if and only if rank(A) = rank([A | b]). If the rank equals the number of unknowns, the solution is unique. Otherwise, the solution space dimension equals the number of unknowns minus the rank (nullity).

5. Can the rank exceed the smallest dimension of a matrix?

No, for an m×n matrix, rank(A) ≤ min(m, n). This is a fundamental bound; a matrix cannot have more independent rows than columns or vice versa.

How to Use

  1. Select the number of rows and columns for your matrix.
  2. Enter the values for each cell in the matrix grid.
  3. The calculator automatically computes the rank and shows the row echelon form.