Skip to content
LoveToCalc

Theorem — what does that mean?

Rank of a matrix

The rank is the number of pivots once the matrix is in row echelon form. The rank and the number of free variables add up to the number of columns.

In Swedish: Rang

Rank of a matrix

The relation

rank A+dim N(A)=n

The rank of a matrix is the number of pivots in an echelon form of it. For an m×n matrix A, rank A + dim N(A) = n: the rank and the number of free variables add up to the number of columns.

Solve for
Solved for dim N(A)

dim N(A)=n−rank A

dim N(A)=1

dim N(A) equals 4 minus 3, equals 1

Working2 steps

Practice questions

You are given

  • rank A=5
  • dim N(A)=2

What the theorem says

The rank of a matrix A, rank A, is the number of pivots in a row echelon form of A. It is the same whichever sequence of row operations you use. For an m×n matrix A, the rank–nullity theorem says

where n is the number of columns and N(A) is the null space, all solutions of Ax = 0. Each column either has a pivot or belongs to a free variable, and dim N(A), the nullity, is the number of free variables. The card above gives the third of the three when you know two; the rank of a matrix of your own, with a basis for its null space, is in the matrix calculator.

Holds for every m×n matrix. The rank is also at most m, since each row holds at most one pivot.

Worked example

A has the rows (1, 2, 0, 1), (0, 1, 1, 0) and (1, 3, 1, 2). R₃ − R₁ gives (0, 1, 1, 1), and then R₃ − R₂ gives (0, 0, 0, 1). The pivots are in columns 1, 2 and 4, so rank A = 3. A has n = 4 columns, and dim N(A) = 4 − 3 = 1.

The free variable belongs to column 3. With x₃ = t the echelon form gives x₄ = 0, x₂ = −t and x₁ = 2t, so the null space consists of the multiples of (2, −1, 1, 0). Check with the first row: 2 − 2 + 0 + 0 = 0.

The same matrix in the matrix calculator.

Columns, not rows

The n in the theorem is the number of columns, which is the number of unknowns. For a square matrix it makes no difference; for any other it does. The matrix with the rows (1, 2, 3) and (2, 4, 6) has two rows and three columns. The second row is twice the first, so R₂ − 2R₁ gives a zero row and the rank is 1.

Count dim N(A)
Right, with the columns 3 − 1 2
Wrong, with the rows 2 − 1 1

The system x + 2y + 3z = 0, 2x + 4y + 6z = 0 is a plane through the origin, and a plane has two free parameters.

A second example: full rank

A square n×n matrix with a non-zero determinant has a pivot in every column, so its rank is n and dim N(A) = 0. Then Ax = 0 has only the solution x = 0, and Ax = b has exactly one solution for every b. That is the case for the matrix with the rows (2, 1, −1), (−3, −1, 2) and (−2, 1, 2) on the page on Gaussian elimination: its rank is 3 and its null space is the zero vector alone.

Where to go next

The rank is found by Gaussian elimination. For a square matrix, full rank is the same as a determinant that is not 0.

The system Ax = b, A with n columns Solutions
rank A = rank [A | b] = n Exactly one
rank A = rank [A | b] < n Infinitely many, with n − rank A free parameters
rank A < rank [A | b] None

Common mistakes

Frequently asked questions

Are the row rank and the column rank the same? Yes. The number of linearly independent rows equals the number of linearly independent columns, and both are the number of pivots. So A and its transpose have the same rank.

What does the rank say about a system of equations? Compare the rank of A with the rank of the augmented matrix [A | b]. If they differ there is no solution. If they agree there are solutions, with n − rank A free parameters.

Can the rank be 0? Only for the zero matrix, the one matrix without a pivot. Then all n variables are free.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
nrank A+dim N(A)3+14
rank An−dim N(A)4−13
dim N(A)n−rank A4−31

Last reviewed November 7, 2026 ·How pages are reviewed

Calculate it in practice

Linear algebraAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.