Eigenvalue & Matrix Properties Calculator: Rank, Condition Number, Stability
Diagnostics for square matrices up to 4×4: rank, trace, determinant, eigenvalues with eigenvectors, and the condition number κ(A). Use this before trusting any numerical work on the matrix.
The central object on this page is the eigendecomposition. When it exists, a square matrix A factors as A = QΛQ⁻¹, with the eigenvalues sitting on the diagonal of Λ and the eigenvectors as columns of Q. Almost every property of A drops out of that one factorization. The determinant is the product of the eigenvalues. The trace is the sum. The rank, for a normal matrix, is the count of non-zero eigenvalues. The condition number is the ratio of the largest absolute eigenvalue to the smallest. And A^k for any power k is just QΛ^kQ⁻¹, which is why eigendecomposition is the standard language for dynamical systems and the foundation of PCA.
For matrix operations themselves (addition, multiplication, transpose, inverse, RREF, or step-by-step row reduction on a system Ax = b), see the matrix calculator. This page handles the diagnostics: rank, trace, eigenvalues, eigenvectors, singular values, and the condition number κ(A). Two halves of the same workflow, separated because they answer different questions and expect different inputs.
Condition number is the property to actually check before any numerical work. κ near 1 means the matrix is well-behaved and small input errors stay small. κ around 10⁶ means tiny perturbations in b can swing the solution to Ax = b by a factor of a million. Past 10¹² and you're past the resolution of double-precision floats: the digits you compute aren't really digits, they're roundoff noise dressed up as signal.
Sizes are capped at 4×4 on purpose. Eigenvalues for matrices larger than that come out of an iterative algorithm (QR with shifts), and the results are harder to interpret on a single screen. For a 6×6 covariance matrix or a 5×5 Jacobian from an optimization, NumPy's np.linalg.eig and SciPy's scipy.linalg.eig run in milliseconds and produce double-precision answers. This page is for understanding what a matrix is, not for production-scale numerics.
Vector and Matrix Input Tips
Vectors are single-row or single-column matrices. A column vector (n×1) multiplies naturally with an m×n matrix from the left: Av is m×1. A row vector (1×n) multiplies from the right: vᵀA is 1×m. Choose orientation based on the operation you need.
Enter matrices row by row, separating entries with commas or tabs. For a 3×3 matrix, input three lines with three values each. Most parsers accept scientific notation (2.5e-4) and negative numbers. Avoid trailing commas—some parsers treat them as extra zero entries.
Copy directly from spreadsheets for larger matrices. Tab-delimited pastes from Excel or Google Sheets typically parse correctly. Verify dimensions after pasting: an unexpected 4×5 instead of 4×4 causes cryptic errors downstream.
Quick check: After input, confirm the displayed matrix matches your source. A misaligned row or missing entry silently corrupts every subsequent calculation.
Rank, Trace, and Determinant Quick Reads
Rank counts linearly independent rows (equivalently, columns). For an m×n matrix, rank ≤ min(m, n). Full rank means rank equals the smaller dimension—no row is a linear combination of others. Rank deficiency signals redundancy or collapsing transformations.
Trace is the sum of diagonal entries: tr(A) = a₁₁ + a₂₂ + ... + aₙₙ. Only defined for square matrices. The trace equals the sum of eigenvalues—a quick consistency check if you compute both. Trace is invariant under similarity: tr(P⁻¹AP) = tr(A).
Determinant measures signed volume scaling under the transformation A represents. det(A) = 0 means singular (non-invertible); det(A) ≠ 0 means invertible. For 2×2: det = ad − bc. The determinant equals the product of eigenvalues.
Relationships:
tr(A) = λ₁ + λ₂ + ... + λₙ
det(A) = λ₁ × λ₂ × ... × λₙ
Eigenvalues and what they say about the matrix
An eigenvector v satisfies Av = λv: the matrix stretches v by factor λ without rotating it. Each eigenvalue has at least one associated eigenvector (often infinitely many, forming an eigenspace). Eigenpairs reveal the matrix's fundamental action on space.
Positive eigenvalues mean stretching along that direction; negative eigenvalues flip and stretch; λ = 0 collapses that direction entirely. Complex eigenvalues (for real matrices) come in conjugate pairs and indicate rotational components—the transformation spirals rather than purely stretches.
Applications abound. In differential equations, eigenvalues determine stability (negative real parts = stable). In principal component analysis, the largest eigenvalues correspond to directions of greatest variance. In Markov chains, the eigenvalue 1 identifies the steady-state distribution.
Stability rule: For continuous systems, all eigenvalues with negative real parts → stable. For discrete systems, all eigenvalues with |λ| < 1 → stable.
Condition number and why it matters
The condition number κ(A) of a matrix is the ratio σ_max(A) / σ_min(A) of its largest to smallest singular values. For a square non-singular A, that's also ‖A‖₂ · ‖A⁻¹‖₂. Mathematically it's a number. Operationally it's a leverage factor. If your input b carries a relative error of ε, the relative error in the solution to Ax = b can be as large as κ(A) · ε. The bound is tight, not pessimistic: there are perturbation directions where the error attains it.
Trefethen and Bau's Numerical Linear Algebra (Lecture 12) frames the rule of thumb cleanly. With double-precision arithmetic (machine epsilon ≈ 10⁻¹⁶) and a condition number κ, you lose roughly log₁₀(κ) digits of accuracy. If κ ≈ 10⁶, you keep ~10 digits of meaningful answer out of 16. If κ ≈ 10¹⁰, you keep about 6. If κ ≈ 10¹², the result is dominated by floating-point roundoff, and any answer you read off the screen is questionable past the second decimal place.
Concrete example. Take the Hilbert matrix H_n with H[i,j] = 1/(i+j-1). It's symmetric positive-definite, all the right properties on paper. But κ(H_5) is about 5×10⁵, and κ(H_10) is around 10¹³. Solve a Hilbert system Ax = b in float64 with n=10 and the answer disagrees with the true solution in the leading digits. The matrix isn't broken. Float64 just doesn't have enough resolution to represent it.
Practical heuristic: check κ(A) before computing A⁻¹b or running any iterative solver. NumPy's np.linalg.cond does it in O(n³) via the SVD. If κ exceeds 10⁸ for a problem you care about, the right move is to switch to a regularized approach. QR with column pivoting handles rank-deficiency cleanly. The Moore-Penrose pseudoinverse via SVD is the heavier option that absorbs both rank-deficiency and ill-conditioning at once. Neither makes a singular matrix invertible. They let you compute a meaningful answer instead of one whose digits are noise.
Existence and uniqueness from rank
A solution exists if b lies in the column space of A—that is, b can be written as a linear combination of A's columns. Equivalently, rank([A | b]) = rank(A). If not, the system is inconsistent: no x satisfies the equation.
Uniqueness depends on the null space. If rank(A) equals the number of unknowns, the null space is trivial (only zero) and the solution is unique. If rank < unknowns, free variables exist and infinitely many solutions satisfy Ax = b.
For square invertible A, x = A⁻¹b gives the unique solution directly. In practice, solve via LU or QR decomposition rather than computing the explicit inverse—decompositions are faster and numerically stabler.
Solution summary for m×n matrix A:
• rank(A) = rank([A|b]) and rank = n → unique solution
• rank(A) = rank([A|b]) and rank < n → infinitely many
• rank(A) < rank([A|b]) → no solution
Decomposition Notes (LU/QR When Available)
LU decomposition factors A = LU where L is lower triangular (ones on diagonal) and U is upper triangular. Solve Ax = b by first solving Ly = b (forward substitution), then Ux = y (back substitution). Faster than computing A⁻¹ explicitly.
QR decomposition factors A = QR where Q is orthogonal (Qᵀ = Q⁻¹) and R is upper triangular. More numerically stable than LU for ill-conditioned matrices. QR underlies least-squares solutions when A is rectangular (m > n).
Singular Value Decomposition (SVD) handles any matrix: A = UΣVᵀ. The singular values (diagonal of Σ) reveal rank and conditioning. SVD enables pseudoinverse computation, image compression, and principal component analysis. Computationally expensive but maximally informative.
When to use which: LU for general square systems; QR for overdetermined or ill-conditioned systems; SVD when you need rank, condition number, or pseudoinverse.
Property questions: rank, trace, eigenvalues
What does it mean if rank is less than the number of columns?
Some columns are linear combinations of others—redundant information. Free variables exist in the solution space. The null space is non-trivial, meaning Ax = 0 has non-zero solutions.
How do I know if my matrix is ill-conditioned?
Compute the condition number κ(A) = σ_max / σ_min (ratio of largest to smallest singular value). κ > 10⁶ signals serious numerical instability—small input perturbations cause large output swings. κ near 1 is ideal.
Can a non-square matrix have an inverse?
Not a true inverse, but a pseudoinverse (Moore-Penrose inverse) always exists. For tall matrices (m > n) with full column rank, the left pseudoinverse is (AᵀA)⁻¹Aᵀ. For wide matrices with full row rank, the right pseudoinverse is Aᵀ(AAᵀ)⁻¹.
Why do symmetric matrices matter?
Symmetric matrices (A = Aᵀ) have all real eigenvalues and orthogonal eigenvectors. They diagonalize as A = QΛQᵀ with orthogonal Q. Covariance matrices, Hessians in optimization, and Laplacians are symmetric—making analysis cleaner.
What happens if I try to invert a singular matrix?
The computation fails or returns garbage. No inverse exists mathematically—det = 0 means the transformation is irreversible. Use pseudoinverse or solve least-squares if you need an approximate solution.
Limitations of these property computations
Eigenvalue accuracy: for matrices larger than 4×4, eigenvalues are computed iteratively (QR algorithm). Results carry small errors, especially when eigenvalues cluster or the matrix is nearly defective.
Condition number is what to look at: κ near 1 is well-conditioned. κ above ~10⁶ means small input perturbations dominate the output. Check it before trusting any numerical solution. If κ is huge and you proceed anyway, the result is noise dressed up as signal.
Complex eigenvalues come in pairs: for a real matrix, complex eigenvalues appear as conjugate pairs. If the page reports only the real ones, the missing eigenvalues are the conjugate companions.
Symbolic results need a CAS: exact eigenvalues as radicals or characteristic polynomials with rational coefficients require Mathematica, Octave's symbolic package, or SymPy. Numerical libraries don't produce them.
Note: Trefethen & Bau's "Numerical Linear Algebra" covers the QR algorithm for eigenvalues and the SVD for rank and condition number. Strang's textbook covers the theoretical side. For property checks at scale, Mathematica and Octave both expose rank, trace, determinant, and the full spectrum cleanly.
Sources & References
Methods and concepts follow established linear algebra references:
- •MIT OpenCourseWare: Linear Algebra 18.06 (Gilbert Strang)
- •3Blue1Brown: Essence of Linear Algebra
- •NumPy Documentation: Linear Algebra Module
Matrix properties: working questions
What does rank tell me about a matrix?
Rank is the number of linearly independent rows (equivalently, columns). It's the dimension of the column space (the range of A as a transformation). Full rank for a square n×n matrix means rank = n, which is equivalent to invertibility, det ≠ 0, and "Ax = b has a unique solution for every b." Rank deficiency means redundancy: some rows or columns can be written as linear combinations of others. For an m×n matrix, rank ≤ min(m, n). Practical use: rank deficiency tells you a regression's design matrix is collinear, or a system of equations has free variables.
What's the trace and what is it good for?
Trace is the sum of the diagonal entries: tr(A) = a₁₁ + a₂₂ + … + aₙₙ. It also equals the sum of the eigenvalues (counted with multiplicity), which is the more useful identity. Trace is invariant under similarity transformations: tr(P⁻¹AP) = tr(A). Properties worth knowing: tr(AB) = tr(BA) (the cyclic property, even when AB ≠ BA), tr(A^T) = tr(A), tr(A + B) = tr(A) + tr(B). Applications: in statistics tr(X^T·X) appears in OLS variance computations; in physics it's the expected value of an observable in a quantum density matrix.
What's the intuition for an eigenvector?
A direction the matrix only stretches, doesn't rotate. If Av = λv, the vector v keeps its direction under A; only its length changes (by factor λ). The eigenvalue λ is the stretch. Most vectors get rotated and stretched simultaneously by a generic matrix, but eigenvectors are the special directions where rotation doesn't happen. Geometrically, the eigenvectors of a symmetric matrix point along the principal axes of the ellipse/ellipsoid it defines through the quadratic form x^T·Ax. PCA and ellipsoid-fitting both rely on this picture.
What's the condition number of a matrix?
κ(A) = σ_max / σ_min, the ratio of the largest to the smallest singular value. It tells you how much a small perturbation in b can change the solution to Ax = b. κ near 1 is well-conditioned. κ around 10⁶ means relative input errors get amplified by up to 10⁶ in the output. κ above ~10¹² means your numerical solution is dominated by floating-point roundoff and shouldn't be trusted. NumPy's np.linalg.cond and MATLAB's cond() compute it. For statistical work, condition number above ~30 in a regression design matrix flags problematic multicollinearity.
Geometric vs algebraic multiplicity, when do they differ?
Algebraic multiplicity is the multiplicity of λ as a root of the characteristic polynomial. Geometric multiplicity is the dimension of the eigenspace for that λ, the number of linearly independent eigenvectors you can find. Geometric ≤ algebraic always. When they're equal for every eigenvalue, the matrix is diagonalizable: A = QΛQ⁻¹ with Λ diagonal. When geometric < algebraic for at least one eigenvalue, the matrix is defective. There aren't enough eigenvectors to span the space, and you need the Jordan canonical form instead of plain diagonalization. The simplest defective example is the 2×2 [[2, 1], [0, 2]]: λ = 2 with algebraic multiplicity 2 but only one eigenvector. Symmetric matrices are never defective (the spectral theorem guarantees orthogonal eigenvectors), which is one reason they're so much friendlier to work with.
Why is Ax = b hard when A is singular or near-singular?
Singular A has rank < n, so the system either has no solution (b not in column space) or infinitely many (b in column space, with a non-trivial null space). Near-singular A is technically invertible, but the inverse amplifies tiny perturbations in b into huge swings in x. Solution: use the pseudoinverse via SVD, A⁺ = V·Σ⁺·U^T, which gives the minimum-norm least-squares solution and handles both rank-deficient and ill-conditioned cases gracefully. NumPy's np.linalg.pinv and np.linalg.lstsq are the standard implementations.
Symmetric matrix properties worth knowing?
All eigenvalues are real (no complex pairs). Eigenvectors corresponding to distinct eigenvalues are orthogonal. The matrix is diagonalizable by an orthogonal change of basis: A = Q·Λ·Q^T with Q orthogonal and Λ diagonal (the spectral theorem). Positive-definite symmetric matrices (all eigenvalues > 0) define inner products and have unique Cholesky factorizations A = L·L^T. Most matrices in statistics that come from quadratic forms (covariance matrices, X^T·X in OLS, Hessians) are symmetric, which is why these properties get used constantly.
What are singular values and how do they relate to eigenvalues?
Singular values are the square roots of the eigenvalues of A^T·A. They're always real and non-negative, even for non-square or complex matrices. The SVD A = U·Σ·V^T expresses any matrix as orthogonal stretches in two coordinate systems with diagonal stretching in between. For symmetric positive-definite A, singular values equal eigenvalues. For general matrices they don't (a rotation has eigenvalues e^(±iθ) but singular values both 1). The largest singular value is the spectral norm ||A||₂, the smallest is 1 / ||A⁻¹||₂ for invertible A, and their ratio is the condition number.
Related Math & Statistics Tools
Matrix Operations Calculator
Perform matrix addition, multiplication, transpose, and more
Regression Calculator
Fit linear and polynomial regression models to your data
Descriptive Statistics
Calculate mean, median, standard deviation, and more
Combinations & Permutations
Calculate nCr, nPr with and without repetition
Probability Calculator
Compute probabilities for various distributions
Logistic Regression Demo
Explore binary classification with sigmoid function