Column space calculator
Get a column space basis straight from the pivot columns. For rows (1, 2, 3), (2, 4, 6) and (1, 0, 1), the original columns (1, 2, 1) and (2, 4, 0) form the basis, so the dimension is 2. Each elimination step is shown. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
A column space calculator answers a classic linear-algebra question: which vectors span the column space of a real matrix? Enter the matrix as nested numeric rows or as plain text with commas and line breaks; the tool runs Gaussian elimination with partial pivoting on a working copy, identifies the pivot columns under a fixed epsilon, and returns the matching columns of the ORIGINAL matrix as a basis—because elementary row operations preserve linear dependencies among columns, pivot columns of the reduced form pick out independent columns of the input. The response includes the basis vectors, the dimension (which equals the rank), the zero-based pivot column indices, the rounded original matrix, the row-echelon form, and ordered elimination steps.
What the column space is and why pivot columns give a basis
The column space of a real m×n matrix A—written Col A—is the set of every linear combination of its columns, which is exactly the set of vectors b for which Ax = b has a solution. Its dimension is the rank of A, and a basis is a smallest set of columns that still spans the whole space.
The standard theorem used here is that elementary row operations preserve the linear relations among columns: if column three of the row-echelon form is twice column one, then column three of the original matrix is twice column one as well. Therefore the columns of A that sit in pivot positions of the echelon form are linearly independent, every other column is a combination of them, and together they form a basis for Col A.
Note the subtle point students miss: the basis vectors come from the ORIGINAL matrix, not from the reduced matrix—the pivot columns of the echelon form generally span a different subspace of R^m, even though both spaces share the same dimension. Entries whose absolute value falls at or below a fixed epsilon after elimination are treated as exact zeros, so floating-point cancellation on nearly dependent columns does not invent phantom pivots and inflate the reported dimension.
The output states every swap and elimination step in order, so you can verify the algorithm path by hand or in a test suite without re-deriving the arithmetic yourself.
Practical tips, limits, and related searches
Keep every entry inside the published absolute range and prefer sending nested number arrays when you control the client; text form is convenient for paste-from-spreadsheet workflows but still parses under the same numeric rules. A classic worked example is the three-by-three matrix with rows [1,2,3], [2,4,6], [1,0,1]: column two is twice column one and the row space collapses, elimination finds pivots in columns zero and one only, and the basis is the first two original columns with dimension two.
The zero matrix is the edge case to remember in tests: it has no pivots, the column space is the singleton zero vector, and this tool returns an empty basis with dimension zero and an explanatory message rather than an error. When columns are nearly but not exactly dependent—common in sensor data and least-squares design matrices—the fixed epsilon decides, so expect borderline columns to be dropped as combinations of earlier ones rather than reported as a fragile full-rank basis.
This landing targets people searching for a column space calculator, basis of column space online, or pivot columns basis; it is not an SVD tool, not an orthonormalizer (the basis is a subset of the original columns, not Gram-Schmidt output), and not a null-space solver—pair it with a rank or null-space capability if you need those.
Round-trip checks are easy: multiply the basis by the dependence coefficients read from the row-echelon form and confirm each dropped column is reproduced exactly after rounding, and confirm that swapping two input columns changes the pivot set predictably.
What you can do with it
Homework checks for column-space basis exercises
Students paste textbook matrices and compare their hand-picked pivot columns and basis vectors against a deterministic result before submitting.
FAQ
How is the column space basis computed here?
The tool reduces a working copy of the matrix to row echelon form with partial pivoting, then takes the columns of the ORIGINAL matrix at the pivot positions. Those columns form a basis for the column space.
Why does the basis use columns of the original matrix, not the reduced one?
Row operations change the column space itself but preserve linear relations among columns. Pivot positions identify which original columns are independent, so the basis must be taken from the input matrix.
What does the zero matrix return?
An empty basis with dimension 0: the column space of the zero matrix is just the zero vector, which has no basis vectors. This is a valid success result, not an error.
Is the column space calculator free?
The browser tool is free and runs locally.
What does the column space tell me about solving Ax = b?
It is exactly the set of vectors b for which Ax = b has a solution. If b lies outside the column space, the system has no solution, whatever x you try, so checking it first saves a long search.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/column-space \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"matrix":[[1,2,3],[2,4,6],[1,0,1]]}'const res = await fetch("https://api.kit.forhosting.com/math/column-space", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"matrix": [
[
1,
2,
3
],
[
2,
4,
6
],
[
1,
0,
1
]
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/column-space",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"matrix": [
[
1,
2,
3
],
[
2,
4,
6
],
[
1,
0,
1
]
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/column-space", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"matrix":[[1,2,3],[2,4,6],[1,0,1]]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"matrix":[[1,2,3],[2,4,6],[1,0,1]]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/column-space", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"matrix": [
[
1,
2,
3
],
[
2,
4,
6
],
[
1,
0,
1
]
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.column_space",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_rows | 32 |
max_cols | 32 |
max_abs | 1000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Any non-finite entry—NaN, Infinity, or non-numeric text—rejects the request with invalid_input instead of producing silent garbage.
What the column space is and why pivot columns give a basis
This tool runs Gaussian elimination with partial pivoting, which swaps the active row with the row holding the largest absolute entry in the current column so division factors stay as well-conditioned as pure elementary-row arithmetic can manage in IEEE doubles.
How to call the API and what comes back
Accept either an array of equal-length numeric rows—for example three rows of three numbers each—or a text block where rows are separated by newlines or semicolons and entries by commas or spaces. Send a JSON body with one required field matrix (aliases rows, A, and data). Every entry must be a finite number whose absolute value stays within the published limit of one trillion, and the whole matrix may have at most thirty-two rows and thirty-two columns so Worker and browser work stays interactive. On success the response sets dimension to the basis size (equal to the rank), rows and cols to the input dimensions, pivot_columns to the zero-based indices of pivot columns in scan order, basis to an array of column vectors taken from the original matrix at those indices, matrix to the rounded original, row_echelon to the rounded reduced form, message to a short English summary, and steps to an ordered array of elimination notes. Failed validation—missing matrix, empty rows, non-finite or out-of-range entries, dimensions above the limits, or inconsistent row lengths—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price. Clients that only need the dimension can read the dimension field and ignore the basis, and clients that need the dependence relations can recover them from the row_echelon field, where each non-pivot column expresses how it combines the pivot columns to its left.
Practical tips, limits, and related searches
Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send jagged rows or symbolic text.
Integration use cases
Unit tests for student linear-algebra code
Generate known-good bases for full-rank, rank-deficient, and zero matrices plus deliberate non-finite-entry rejections for coding kata expected values.
Feature-selection pre-checks in data pipelines
Pipelines detect redundant numeric columns in a design matrix: non-pivot columns are linear combinations of earlier ones and can be dropped before fitting.
Technical questions
What if an entry is not a finite number?
NaN, Infinity, missing cells, or non-numeric text make the request invalid_input with a message naming the offending position. Failed requests are never charged.