Null Space Calculator

Null Space Calculator
Computes a basis for the null space via reduced row echelon form.

The null space of a matrix, also called its kernel, is the set of every vector that the matrix sends to the zero vector. If multiplying a matrix A by a vector x gives zero, then x belongs to the null space of A. This simple idea sits at the heart of solving linear systems, testing for linear independence, and understanding matrix transformations.

Finding a null space by hand means row reducing a matrix to reduced row echelon form, identifying which variables are free, and writing down the basis vectors that generate every solution. The arithmetic is straightforward for small matrices but tedious, and one sign error ruins the result. The Null Space Calculator performs Gauss-Jordan elimination for you, identifies the pivot and free variables, and reports the nullity plus a clean basis.

This article explains the mathematics behind the null space, walks through the hand method, shows how to use the calculator, and works through fully verified examples. Along the way you will see the rank-nullity theorem in action, learn what the null space dimension reveals about a matrix, and discover where null spaces appear in science and engineering.

What Is the Null Space of a Matrix

For an m by n matrix A, the null space is the set of all vectors x in n-dimensional space such that Ax equals the zero vector. Mathematicians write it as N(A) and sometimes call it the kernel. Every matrix has a null space, and the zero vector always belongs to it, since any matrix times the zero vector is zero.

The null space is a subspace, meaning it is closed under addition and scalar multiplication. If two vectors both satisfy Ax = 0, their sum does too, and any scalar multiple of either vector does as well. This closure property is what makes a basis possible: a small set of basis vectors such that every member of the null space is a unique linear combination of them.

The dimension of the null space is called the nullity. A nullity of zero means only the zero vector maps to zero, so the columns are linearly independent. A positive nullity means nontrivial solutions to Ax = 0 exist, with the nullity counting their free parameters. The calculator reports this number prominently because it summarizes the whole solution set in a single figure.

Rank, Nullity, and the Rank-Nullity Theorem

Rank and nullity are two sides of the same coin. The rank of a matrix is the number of pivot columns in its reduced row echelon form, which also equals the dimension of its column space. The nullity is the number of non-pivot columns, the columns tied to free variables. Together they account for every column of the matrix.

The Rank-Nullity Relationship

The rank-nullity theorem states that for any m by n matrix, rank plus nullity equals n, the number of columns. Every column is either a pivot column or a free column, so the two counts always sum to the total. For a 3 by 4 matrix, a rank of 2 forces a nullity of 2, and a rank of 3 forces a nullity of 1.

Why This Relationship Matters for Checking Answers

This theorem is a built-in sanity check. Row reduce a 2 by 3 matrix, find one pivot column, and the nullity must be 2 with exactly two basis vectors. If a result violates rank plus nullity equals the number of columns, something went wrong. Keeping this relationship in mind turns a blind computation into a verifiable one.

Computing the Null Space by Hand

The hand method has three stages: row reduce the matrix, sort variables into pivot and free groups, and express basis vectors through the free variables. The calculator performs exactly these steps internally.

Step 1: Row Reduce to Reduced Row Echelon Form

Apply elementary row operations until the matrix reaches reduced row echelon form, abbreviated RREF. In RREF every pivot is 1, each pivot is the only nonzero entry in its column, and pivots step down to the right through the rows. Gauss-Jordan elimination, the same sequence of operations you would do on paper, produces this form.

Step 2: Identify Pivot and Free Variables

In RREF, columns containing leading ones are pivot columns, and their variables are the pivot variables. The remaining columns correspond to free variables, which may take any value. The count of free variables equals the nullity. This sorting step is the conceptual core of the method, revealing how many degrees of freedom the solution set has.

Step 3: Read Off the Basis Vectors

For each free variable, set it to 1 and all other free variables to 0, then solve for the pivot variables from the RREF equations. This yields one basis vector per free variable. Together these vectors form a basis for the null space, and every solution to Ax = 0 is a unique linear combination of them.

How the Null Space Calculator Works

The calculator automates the entire hand method. It accepts 2 by 2, 3 by 3, and 3 by 4 matrices through an entry grid, runs Gauss-Jordan elimination to RREF, determines rank and nullity, and constructs the basis vectors. Results appear instantly, making it ideal for checking homework and building intuition.

Entering a Matrix in the Grid

Select the size matching your problem, then type each entry into the grid cells. The calculator handles integers, decimals, and negative numbers. Place each number carefully, since a misplaced entry changes the null space entirely. Clear the grid and re-enter the values if you need to start over.

What the Results Show

The output reports the nullity, the dimension of the null space, followed by the basis vectors in coordinate form. A nullity of zero means the null space is trivial and holds only the zero vector. A positive nullity means the listed vectors span the full null space. Verify any basis vector by multiplying the original matrix by it and confirming the result is the zero vector.

Worked Examples with Verified Results

The following examples were computed with the calculator and verified by direct multiplication, covering a nontrivial null space, a trivial null space, and a singular square matrix.

Example 1: A 2 by 3 Matrix with a One-Dimensional Null Space

Take the matrix with rows [1, 2, 3] and [4, 5, 6]. Subtract 4 times the first row from the second to get [0, -3, -6], divide that row by -3 to get [0, 1, 2], then subtract twice the second row from the first. The RREF is rows [1, 0, -1] and [0, 1, 2]. The pivot columns are the first and second, so x3 is the single free variable, with x1 = x3 and x2 = -2x3. Setting x3 to 1 gives the basis vector (1, -2, 1), and the nullity is 1.

Multiplication confirms the result. First row: 1(1) + 2(-2) + 3(1) = 1 – 4 + 3 = 0. Second row: 4(1) + 5(-2) + 6(1) = 4 – 10 + 6 = 0. Both hold, so (1, -2, 1) is in the null space, and every vector there is a scalar multiple of it.

Example 2: The 2 by 2 Identity Matrix and the Trivial Null Space

The 2 by 2 identity matrix is already in RREF, with pivots in both columns and no free variables. The only solution to Ax = 0 is x = (0, 0), so the null space is trivial and the nullity is 0. This matches the rank-nullity theorem: rank 2 plus nullity 0 equals 2 columns.

Example 3: A Singular 2 by 2 Matrix

Take the matrix with rows [2, 4] and [1, 2]. The second row is half the first, so the matrix is singular. Subtract half of the first row from the second and divide the first row by 2 to reach RREF: rows [1, 2] and [0, 0]. With one pivot column, x2 is free and the nullity is 1. The equation gives x1 = -2x2, so the basis vector is (-2, 1). Checking: 2(-2) + 4(1) = 0 and 1(-2) + 2(1) = 0, confirming the basis.

What the Nullity Tells You About a Matrix

The nullity summarizes a matrix’s behavior. A nullity of zero means the transformation is one-to-one: distinct inputs give distinct outputs, and the columns are linearly independent. Square matrices with nullity zero are invertible, which is why the identity matrix example behaves so cleanly.

A positive nullity means the transformation collapses some nonzero directions to zero. The columns are linearly dependent, and Ax = 0 has infinitely many solutions forming a subspace of the stated dimension.

Nullity also governs whether Ax = b has a unique solution. When the system is consistent and the nullity is zero, the solution is unique. With positive nullity, adding any null space vector to one solution gives another, so infinitely many solutions exist. Reading the nullity first tells you which case you are in.

Common Mistakes to Avoid

Null space computations fail for predictable reasons. Watch for these errors whether you compute by hand or use the calculator.

  • Stopping at row echelon form. The substitution step needs the fully reduced form with zeros above each pivot.
  • Mixing up pivot and free variables. Only columns without a leading one give free variables, each contributing exactly one basis vector.
  • Sign errors during elimination. One flipped sign changes the basis vectors, so verify each by multiplying with the original matrix.
  • Forgetting the zero vector always belongs. The question is never whether the null space is empty, only whether it holds anything beyond zero.
  • Mis-entering the matrix in the grid. Transposed or shifted entries produce the null space of a different matrix.
  • Confusing null space with column space. The null space lives in the input space with Ax = 0, while the column space lives in the output space and holds the products Ax.

Where Null Spaces Appear in Real Problems

The null space appears wherever linear relationships must be understood, from pure mathematics to engineering.

  • Homogeneous linear systems. The complete solution set of Ax = 0 is the null space, so a basis solves the system in closed form.
  • Testing linear dependence. Vectors are dependent exactly when their matrix has a nontrivial null space.
  • Differential equations. The solution space of a linear homogeneous differential equation is a null space of the associated operator.
  • Computer graphics. Projection matrices use null spaces to describe collapsing directions, such as the viewing direction in perspective projection.
  • Control theory and robotics. Redundant robot-arm motions correspond to the null space of the Jacobian, allowing reconfiguration without moving the end effector.
  • Least squares fitting. The null space of a design matrix reveals which parameter combinations the data cannot distinguish.

Null Spaces and Homogeneous Linear Systems

Every homogeneous system Ax = 0 asks for the null space of A directly. Computing a null space and solving a homogeneous system are the same task in different words: the RREF exposes pivot and free variables, and the free variables become the parameters of the general solution.

This link also explains the general solution of non-homogeneous systems. When Ax = b has a particular solution xp, every solution equals xp plus a null space vector. The null space measures the ambiguity: nullity zero gives uniqueness, positive nullity gives solution families parameterized by the free variables. The calculator’s basis vectors are exactly the directions along which solutions can vary.

Conclusion

The null space captures everything a matrix sends to zero, and its basis is the most compact description of that set. Row reduce to RREF, separate pivot variables from free variables, and read off one basis vector per free variable. The rank-nullity theorem keeps the arithmetic honest, and multiplying each basis vector by the original matrix provides a final check.

The Null Space Calculator performs these steps instantly for 2 by 2, 3 by 3, and 3 by 4 matrices, reporting the nullity and basis vectors in verifiable form. Use it to check hand computations and build intuition. Whether you are solving homogeneous systems, testing for dependence, or analyzing a transformation, the null space is the right tool.

Frequently Asked Questions

What is a null space in simple terms?

The null space of a matrix is the set of all vectors that the matrix maps to the zero vector. If multiplying matrix A by vector x gives zero, then x is in the null space of A. It always contains at least the zero vector and forms a subspace closed under addition and scalar multiplication.

What does a nullity of zero mean?

A nullity of zero means the null space is trivial and contains only the zero vector. This happens when every column is a pivot column, leaving no free variables. For square matrices, nullity zero is equivalent to the matrix being invertible.

Can a null space ever be empty?

A null space can never be empty because the zero vector always satisfies Ax = 0. The smallest possible null space is the trivial one holding only the zero vector. A claim of an empty null space signals a misunderstanding or a computation error.

How is the null space different from the column space?

The null space lives in the input space and contains vectors x with Ax = 0, while the column space lives in the output space and contains all products Ax. The rank-nullity theorem links them: column space dimension plus null space dimension equals the number of columns.

Why do I need reduced row echelon form instead of just row echelon form?

Reduced row echelon form has zeros above every pivot, letting you read each pivot variable directly from the free variables. Plain row echelon form leaves nonzero entries above the pivots, making back-substitution error-prone. The calculator uses Gauss-Jordan elimination to reach the fully reduced form.

How many vectors are in a null space basis?

The count always equals the nullity, which is the number of free variables. Each free variable generates one basis vector by setting it to 1 and the others to 0. The rank-nullity theorem confirms the count: basis vectors plus pivots must equal the number of columns.

Is the null space the same as the solution set of Ax = 0?

Yes, they are exactly the same set. The null space of A is defined as all vectors x satisfying Ax = 0, which is precisely the solution set of that homogeneous system. A basis for the null space writes the complete solution in parametric form.

What matrix sizes does the Null Space Calculator support?

The calculator supports 2 by 2, 3 by 3, and 3 by 4 matrices entered through an on-screen grid. These sizes cover the matrices most common in coursework and quick checks, and each uses the same Gauss-Jordan procedure internally.

Why does the 2 by 2 identity matrix have a trivial null space?

The identity matrix is already in reduced row echelon form with pivots in both columns, so there are no free variables. The only vector satisfying Ax = 0 is the zero vector, giving nullity 0, consistent with the identity matrix being invertible.

How do I verify that a vector is in the null space?

Multiply the original matrix by the candidate vector and check that every entry of the result is zero. For the basis vector (1, -2, 1) with rows [1, 2, 3] and [4, 5, 6], the check is 1 – 4 + 3 = 0 and 4 – 10 + 6 = 0. This multiplication catches most arithmetic mistakes.

What is the difference between nullity and rank?

Nullity is the dimension of the null space and counts free variables, while rank is the dimension of the column space and counts pivot columns. For an m by n matrix they always sum to n. High rank means most columns are independent, while high nullity means many directions collapse to zero.

Can the null space hold infinitely many vectors while its basis stays small?

Yes, and this is the normal situation. A one-dimensional null space holds infinitely many vectors, all scalar multiples of a single basis vector. The basis stays small because it only captures the independent directions, while scalar multiplication generates the infinite rest.

Does a tall matrix with more rows than columns have a nontrivial null space?

Not necessarily. A tall matrix can have full column rank, with every column a pivot column and nullity zero. Extra rows only force a nontrivial null space when they create dependence among the columns. The same pivot-count logic applies regardless of the row count.

What is the connection between the null space and linear dependence?

Vectors are linearly dependent exactly when their matrix has a nontrivial null space. A nonzero null space vector supplies the coefficients of a dependence relation among the columns. If the nullity is zero, no such relation exists and the columns are independent.

Why does the calculator show fractions instead of decimals?

Fractions preserve exactness while decimals introduce rounding. Row reduction often produces ratios like one half or two thirds, and fractions keep the basis vectors exact. Exact fractions also make the verification step, multiplying the matrix by the basis vector, come out cleanly to zero.