Subspace Basis Calculator
Find bases for the span of your vectors and the column, row and null spaces of a numeric matrix. Enter up to 10 rows and 10 columns, choose whether your vectors are columns or rows, then press Find bases. Results include exact coordinates in the selected basis, left null space, row operations and optional Gram-Schmidt.
Result
RREF(A), with the pivots outlined
| 1 (pivot) | 0 | −1 |
| 0 | 1 (pivot) | 2 |
| 0 | 0 | 0 |
- Pivot columns: 1, 2
- Basis of the span, from your columns: v1, v2
- Null space basis: (1, −2, 1)
- Residual A·n = (0, 0, 0)
Rank 2 and nullity 1 for a 3 × 3 matrix: the 3 column vectors span a space of dimension 2.
- Rank
- 2
- Nullity
- 1
- Pivot columns
- 1, 2
- Residual check
- Exact zero, 1 vector
Bases
Dependent vectors
Each is a combination of the basis vectors chosen from your columns, read off its column of RREF(A) and then recomputed exactly.
- v3 = −v1 + 2·v2 (checked exactly)
Coordinates in the selected basis
Basis order: v1, v2. Coordinate matrix columns: v3.
- [v3] = (−1, 2)
| −1 |
| 2 |
For a change of basis, enter the destination basis first, then the source basis. If both are independent bases of the same span, the coordinate matrix maps source coordinates to destination coordinates. Check that the listed basis and remaining columns match those two lists.
Left null space
Weights on the rows of A, solving A transpose times l = 0.
- l1 = (1, −2, 1); A transpose × l1 = (0, 0, 0)
Checks
- A × n1 = (0, 0, 0), exactly zero
- rank + nullity = 2 + 1 = 3, the number of columns
Row reduction
5 row operations take A to its reduced row echelon form, in exact fractions.
Worked examples
Common questions
- How do you find a basis for the span of a set of vectors?
- Put the vectors in as the columns of a matrix and row reduce it. The columns that end up holding a pivot mark a basis: take those vectors from your original list, not from the reduced form. With (1, 2) and (2, 4), the reduced form has one pivot, in column 1, so (1, 2) alone is a basis, the span has dimension 1, and the page shows v2 = 2·v1. If your vectors are written as rows, choose Rows: the independent rows are then picked the same way, by reducing the transpose, and the non-zero rows of the reduced form are given as a second basis of the same span.
- How do I find the null space or kernel of a matrix?
- Row reduce it. Each column without a pivot is a free variable. Set one free variable to 1 and the others to 0, read the pivot variables off the reduced form, and you have one basis vector for each free column. For the matrix [1 2], the equation is x1 + 2x2 = 0, x2 is free, and the basis vector is (−2, 1). The number of these vectors is the nullity, and rank plus nullity equals the number of columns: 1 + 1 = 2 here. Each null space vector is multiplied back through the matrix and the product is shown, so you can see it is exactly zero.
- What are the column space, image, range and row space of a matrix?
- For the linear map defined by a matrix, its image or range is the column space: every combination of its columns. The row space is every combination of its rows. Both have dimension equal to the rank. A column-space basis uses pivot columns from the original matrix; a row-space basis uses non-zero rows of the reduced form. For [1 2 3; 4 5 6; 7 8 9], these are (1, 4, 7) and (2, 5, 8) for the column space, and (1, 0, −1) and (0, 1, 2) for the row space.
- What does Gram-Schmidt do here, and what happens if my vectors are dependent?
- It takes your vectors in order and subtracts from each one its projections onto the orthogonal vectors before it, in exact fractions, so the vectors it keeps are pairwise orthogonal and span the same space. If what is left of a vector is exactly the zero vector, that vector already lies in the span of the earlier ones: it is reported as dependent and skipped, so nothing is ever divided by zero. With (1, 2) then (2, 4), the second is reported as dependent. Orthonormal also divides each kept vector by its length: (3, 4) becomes (3/5, 4/5) exactly, while (1, 1, 0) becomes (1, 1, 0)/√2, shown as well as 0.707106781187 in decimals labelled approximate.
- Why are the answers fractions instead of decimals?
- Whether a vector depends on the others is an exact question. A vector is dependent only when its remainder after elimination is exactly zero, and in decimal arithmetic a remainder that should be zero often comes out as a tiny number such as 0.0000000000000004, which a program then has to guess about. Here every entry is a fraction of two whole numbers and nothing is rounded, so a zero is exactly zero and a pivot is never an artefact of rounding. The only decimals the page computes are the approximate readings of orthonormal vectors, and they are labelled as approximate.
- What can I type in a cell, and how large can the matrix be?
- A whole number, a decimal like 0.5, a fraction like 1/3, exponent notation like 1.5e-2, or a number with a minus sign pasted from a PDF. A blank cell counts as 0, and 0.1 is read exactly as 1/10. The matrix can have up to 10 rows and 10 columns, and each entry can have up to 12 digits above and below the line, which keeps even a dense 10 × 10 of long fractions quick to reduce. To enter a whole matrix at once, open Paste rows instead, put one row per line and press Fill grid. The last matrix of your own that reduced successfully is kept in this browser, with your settings, and restored on your next visit; nothing is uploaded.
- Can I find coordinates relative to an ordered basis or a change-of-basis matrix?
- Enter the independent destination-basis vectors first as columns, then the vector or source-basis vectors you want to express. The Coordinates in the selected basis section lists coordinate vectors and a matrix with those vectors as columns, in the stated order. For destination basis (1, 0), (1, 1) and source basis (2, 1), (−1, 1), the matrix is [1 −2; 1 1]. It maps source coordinates to destination coordinates. If a later vector adds a new direction, it joins the selected basis; check that the listed basis matches your intended destination. Both bases must span the same space for a change of basis.
- What is the left null space?
- It consists of row weights l for which A transpose times l is zero. The separate Left null space section computes a basis and each transpose residual automatically. For [1 2 3; 4 5 6; 7 8 9], a basis is (1, −2, 1), and the transpose product is (0, 0, 0). Its dimension is the number of rows minus the rank; the usual nullity uses the number of columns instead.
- Can I find an ordered basis in R3 or an orthonormal basis of a plane?
- Enter spanning vectors with three components and choose Columns or Rows to match their arrangement. The span basis keeps the first independent vectors in their input order. For a plane supplied by spanning vectors, choose Orthonormal under Gram-Schmidt to get a unit basis of that same span. Dependent and zero vectors are reported and skipped.
- Can I paste equations, variables or eigenvalue expressions?
- Cells and Paste rows instead accept numeric entries only. They do not parse equation text or symbolic variables, compute eigenspaces, or produce a Jordan, dual or Groebner basis.
Exact within its bounds: row reduction, rank, nullity, every basis and every residual check use fractions of whole numbers with no rounding, for up to 10 rows and 10 columns with numerators and denominators of up to 12 digits. Orthonormal vectors are shown exactly, with a square root where the length is irrational, and as decimals rounded to 12 significant digits that are labelled approximate. It finds bases, not matrix products, inverses or eigenvalues.