Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
MatrixRank
  • See Also
    • NullSpace
    • RangeSpace
    • Det
    • Eigensystem
    • RowReduce
    • SingularValueList
    • Inverse
  • Related Guides
    • Linear Systems
    • Matrix Operations
    • Matrices and Linear Algebra
    • Finite Fields
  • Tech Notes
    • Solving Linear Systems
    • Implementation notes: Numerical and Related Functions
    • Implementation notes: Algebra and Calculus
    • See Also
      • NullSpace
      • RangeSpace
      • Det
      • Eigensystem
      • RowReduce
      • SingularValueList
      • Inverse
    • Related Guides
      • Linear Systems
      • Matrix Operations
      • Matrices and Linear Algebra
      • Finite Fields
    • Tech Notes
      • Solving Linear Systems
      • Implementation notes: Numerical and Related Functions
      • Implementation notes: Algebra and Calculus

MatrixRank[m]

gives the rank of the matrix m.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Special Matrices  
Options  
Modulus  
Tolerance  
Applications  
Spans and Linear Independence  
Equation Solving and Invertibility  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • NullSpace
    • RangeSpace
    • Det
    • Eigensystem
    • RowReduce
    • SingularValueList
    • Inverse
  • Related Guides
    • Linear Systems
    • Matrix Operations
    • Matrices and Linear Algebra
    • Finite Fields
  • Tech Notes
    • Solving Linear Systems
    • Implementation notes: Numerical and Related Functions
    • Implementation notes: Algebra and Calculus
    • See Also
      • NullSpace
      • RangeSpace
      • Det
      • Eigensystem
      • RowReduce
      • SingularValueList
      • Inverse
    • Related Guides
      • Linear Systems
      • Matrix Operations
      • Matrices and Linear Algebra
      • Finite Fields
    • Tech Notes
      • Solving Linear Systems
      • Implementation notes: Numerical and Related Functions
      • Implementation notes: Algebra and Calculus

MatrixRank

MatrixRank[m]

gives the rank of the matrix m.

Details and Options

  • MatrixRank works on both numerical and symbolic matrices.
  • The rank of a matrix is the number of linearly independent rows or columns.
  • MatrixRank[m,Modulus->p] finds the rank for rational matrices modulo the prime p. If p is zero, ordinary arithmetic is used.
  • MatrixRank[m,ZeroTest->test] evaluates test[m[[i,j]]] to determine whether matrix elements are zero. The default setting is ZeroTest->Automatic.
  • MatrixRank[m,Tolerance->t] gives the minimum rank with each element in a numerical matrix assumed to be correct only to within tolerance t.
  • MatrixRank works with sparse arrays and structured arrays.

Examples

open all close all

Basic Examples  (3)

Find the number of linearly independent rows of a numerical matrix:

Find the number of linearly independent rows of a symbolic matrix:

Compute the rank of a rectangular matrix:

Scope  (12)

Basic Uses  (7)

Find the rank of a machine-precision matrix:

Rank of a complex matrix:

Rank of an exact, rectangular matrix:

Find the rank of an arbitrary-precision matrix with more rows than columns:

Compute the rank of a symbolic matrix:

MatrixRank assumes all symbols to be independent:

Computing the rank of large machine-precision matrices is efficient:

Compute the rank of a matrix with finite field elements:

Special Matrices  (5)

The rank of a sparse matrix:

The rank of structured matrices:

IdentityMatrix always has full rank:

HilbertMatrix always has full rank:

Compute the rank of a matrix of univariate polynomials of degree :

Options  (2)

Modulus  (1)

The rank of a matrix depends on the modulus used:

With ordinary arithmetic, m has the full rank of 3:

With arithmetic modulo 5, the rank is only 2:

Tolerance  (1)

The setting of Tolerance can affect the estimated rank for numerical ill-conditioned matrices:

In exact arithmetic, m has full rank:

With machine arithmetic, the default is to consider elements that are too small as zero:

With zero tolerance, even small terms may be taken into account:

With a tolerance greater than the pivot in the middle row, the last two rows are considered zero:

Applications  (11)

Spans and Linear Independence  (5)

The following three vectors are not linearly independent:

Therefore the matrix rank of the matrix whose rows are the vectors is 2:

The following three vectors are linearly independent:

Therefore the matrix rank of the matrix whose rows are the vectors is 3:

Determine if the following vectors are linearly independent or not:

The rank of the matrix formed from the vectors is less than four, so they are not linearly independent:

Find the dimension of the column space of the following matrix:

The dimension of the space of all linear combinations of the columns equals the matrix rank:

Find the dimension of the subspace spanned by the following vectors:

Since the matrix rank of the matrix formed by the vectors is three, that is the dimension of the subspace:

Equation Solving and Invertibility  (6)

Determine if the following system of equations has a unique solution:

Rewrite the system in matrix form:

The coefficient matrix has full rank, so the system has a unique solution:

Verify the result using Solve:

Determine if the following matrix has an inverse:

The rank is less than the dimension of the matrix, so it is not invertible:

Verify the result using Inverse:

Determine if the following matrix has a nonzero determinant:

Since it has full rank, its determinant must be nonzero:

Confirm the result using Det:

is an eigenvalue of if does not have full rank. Moreover, a matrix is deficient if it has an eigenvalue whose multiplicity is greater than the difference between the rank of and the number of columns. Show that is an eigenvalue for the following matrix :

Confirm the result using Eigenvalues:

The matrix is deficient because 2 appears twice, but the difference in rank is only one:

Confirm the result with Eigensystem, which indicates deficiency by padding the eigenvector list with zeros:

Most but not all random 10×10 0–1 matrices have full rank:

Estimate the average rank of a random 10×10 0–1 matrix:

Find the ranks of coprimality arrays:

Compute the first 50 such arrays. Only the first three have full rank:

Visualize the growth in rank versus the dimension of the matrix:

Properties & Relations  (9)

By the rank-nullity theorem, MatrixRank[m] is the number of columns minus the dimension of the null space:

The column and row rank of a matrix are equal:

MatrixRank[m] equals the number of nonzero rows in RowReduce[m]:

For a square matrix, m has full rank if and only if Det[m]!=0:

For a square matrix, m has full rank if and only if the null space is empty:

For a square matrix, m has full rank if and only if m has an inverse:

For a square matrix, m has full rank iff LinearSolve[m,b] has a solution for a generic b:

MatrixRank[m] is equal to Length[SingularValueList[m]]:

The outer product of vectors has matrix rank 1:

Possible Issues  (2)

MatrixRank may depend on the precision of the given matrix:

Use exact arithmetic to compute the matrix rank exactly:

Use machine arithmetic. Machine numbers cannot distinguish between and :

Use 24‐digit-precision arithmetic:

MatrixRank assumes all symbols to be independent:

The special case gives a different result:

See Also

NullSpace  RangeSpace  Det  Eigensystem  RowReduce  SingularValueList  Inverse

Function Repository: Nullity  LinearlyIndependent

Tech Notes

    ▪
  • Solving Linear Systems
  • ▪
  • Implementation notes: Numerical and Related Functions
  • ▪
  • Implementation notes: Algebra and Calculus

Related Guides

    ▪
  • Linear Systems
  • ▪
  • Matrix Operations
  • ▪
  • Matrices and Linear Algebra
  • ▪
  • Finite Fields

History

Introduced in 2003 (5.0) | Updated in 2007 (6.0) ▪ 2014 (10.0) ▪ 2022 (13.2) ▪ 2024 (14.0)

Wolfram Research (2003), MatrixRank, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixRank.html (updated 2024).

Text

Wolfram Research (2003), MatrixRank, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixRank.html (updated 2024).

CMS

Wolfram Language. 2003. "MatrixRank." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MatrixRank.html.

APA

Wolfram Language. (2003). MatrixRank. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MatrixRank.html

BibTeX

@misc{reference.wolfram_2025_matrixrank, author="Wolfram Research", title="{MatrixRank}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/MatrixRank.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_matrixrank, organization={Wolfram Research}, title={MatrixRank}, year={2024}, url={https://reference.wolfram.com/language/ref/MatrixRank.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English