Condition Number Calculator
Enter your square matrix and choose a norm to instantly compute the condition number - the key measure of how sensitive a linear system is to rounding errors and perturbations. Switch between 2x2 and 3x3 matrix sizes, select from four norms, and see the full derivation in the steps panel below.
Formula
Worked example
For A = [[3, 1], [1, 2]] with the 2-norm: the matrix norm is approximately 3.618, the inverse norm is approximately 0.720, so kappa(A) = 3.618 x 0.720 = 2.605 - well-conditioned.
What is the condition number of a matrix?
The condition number kappa(A) measures how sensitive the solution of a linear system Ax = b is to small changes in A or b. Formally it equals the product of the matrix norm and the norm of its inverse: kappa(A) = ||A|| * ||A^-1||. A value close to 1 means errors do not amplify - the matrix is well-conditioned. Large values mean even tiny rounding errors in the inputs can cause huge errors in the computed solution, making the matrix ill-conditioned. The condition number depends on the choice of matrix norm; the 2-norm (spectral norm) is the most frequently cited because it equals the ratio of the largest to the smallest singular value, but the 1-norm and infinity-norm are cheaper to compute by hand.
How to use this calculator
Select your matrix size (2x2 or 3x3) and the desired norm, then enter each element in the grid. The condition number, matrix norm, inverse norm, and determinant all update instantly. The Steps panel below the result shows the full derivation: writing out A, computing its determinant, evaluating the norms, multiplying them, and estimating how many significant digits you can expect to lose in double-precision arithmetic. If the determinant is zero the matrix is singular and the condition number is infinite - no unique solution exists for Ax = b.
Four norm choices and what they measure
The 1-norm (maximum column sum of absolute values) and infinity-norm (maximum row sum) are easy to compute by hand and are used in many error-bound theorems. The 2-norm, also called the spectral norm, equals the ratio of the largest to the smallest singular value and provides the tightest bound on how much a unit-norm perturbation can grow. The Frobenius norm treats the matrix as a long vector and takes the square root of the sum of squared entries; it is not a natural norm in the sense of being induced by a vector norm, but it is smooth and differentiable, making it popular in optimization. All four norms give a condition number of 1 for the identity matrix.
Practical implications for numerical computation
In double-precision floating point you have about 15 to 16 reliable decimal digits. If kappa(A) is about 10^k, you can expect to lose roughly k significant digits in the computed solution. A condition number of 1000 (10^3) costs about 3 digits, leaving around 12 reliable digits, which is generally acceptable. A condition number of 10^10 leaves only 5 or 6 reliable digits, and at 10^15 the result is essentially noise. Common remedies for ill-conditioned systems include scaling the rows and columns (equilibration), using a better pivot strategy (partial or complete pivoting), preconditioning iterative solvers, or switching to higher-precision arithmetic. In regression, a high condition number of X^T X warns that your predictors are nearly collinear.
Condition number interpretation
| kappa(A) range | Classification | Accuracy impact |
|---|---|---|
| 1 | Perfect (identity matrix) | No amplification |
| 1 to 10 | Well-conditioned | Negligible error amplification |
| 10 to 100 | Mildly ill-conditioned | Minor precision loss |
| 100 to 1000 | Ill-conditioned | Noticeable precision loss |
| 1,000 to 10^6 | Poorly conditioned | Significant digit loss |
| Above 10^6 | Severely ill-conditioned | Results unreliable |
| Infinity | Singular | No unique solution exists |
These thresholds apply for double-precision floating point (~15-16 significant digits). Higher precision arithmetic shifts the boundaries.
Frequently asked questions
What does a condition number of 1 mean?
A condition number of exactly 1 is the best possible. It means the matrix does not amplify errors at all; the identity matrix is the classic example. In practice, any value under 10 is considered well-conditioned for most engineering and scientific purposes.
What is the difference between the 1-norm and 2-norm condition number?
The 1-norm condition number uses the maximum absolute column sum of each matrix, while the 2-norm uses the largest singular value ratio. They can give different numbers for the same matrix, but they are within a factor of n of each other (where n is the matrix size). The 2-norm gives the tightest bound and is the default in most numerical libraries such as NumPy and MATLAB.
Can the condition number be less than 1?
No. By definition, kappa(A) = ||A|| * ||A^-1|| is always at least 1 for any invertible matrix and any consistent norm. This lower bound is achieved only by scalar multiples of orthogonal matrices (matrices whose columns are orthonormal). A condition number of 1 means the matrix is perfectly conditioned.
My matrix has a tiny determinant - is it ill-conditioned?
Not necessarily. The determinant depends on the scale of the entries and grows with the matrix size, so a small determinant alone says nothing about conditioning. A 1000x1000 matrix of all 0.1 entries has a tiny determinant but may be well-conditioned. Judge conditioning by kappa(A), not by det(A).
How do I fix an ill-conditioned matrix?
Several strategies help: (1) Diagonal scaling - divide each row by the norm of that row so entries are comparable in magnitude. (2) Pivoting - reorder rows and columns to put the largest entries on the diagonal before solving. (3) Preconditioning - multiply by a matrix P that approximates A^-1 so that P*A is closer to the identity. (4) Regularization - add a small multiple of the identity (Tikhonov regularization) to make the system better conditioned at the cost of a slight bias in the solution.