Null space calculator
The rows (1, 2, 3) and (2, 4, 6) have rank 1, so their null space needs two basis vectors: (−2, 1, 0) and (−3, 0, 1). Enter any matrix row by row to get its kernel basis, nullity and rank. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
A null space calculator answers the linear-algebra question Ax equals zero: which vectors x in real n-space are sent to the origin by a matrix A given as rows of numeric entries? This tool builds a basis for that kernel by reducing the matrix to reduced row echelon form, reading free columns as free variables, and assembling one special solution per free variable so that each returned array satisfies A v equals zero. When the matrix has full column rank the kernel is trivial and the basis is the empty list; when rank is smaller than the number of columns, the rank-nullity theorem says the nullity equals n minus rank, and that many independent vectors come back as arrays.
What the null space is and how a basis is built from RREF
The null space, also called the kernel, of a real m-by-n matrix A is the set of all column vectors x in R^n such that A x equals the zero vector in R^m. It is always a subspace: it contains the origin, and it is closed under addition and scalar multiplication. Its dimension is the nullity of A.
The rank-nullity theorem states that rank of A plus nullity of A equals n, the number of columns, so a full-column-rank matrix has a trivial kernel whose only member is the zero vector, while a rank-deficient matrix has a positive-dimensional kernel. This calculator finds a basis by Gauss-Jordan elimination with partial pivoting to reduced row echelon form. Each leading one is a pivot; columns without a pivot are free.
The resulting list of arrays spans the kernel and is linearly independent by construction, which is exactly the classroom definition of a basis. Entries whose absolute value falls at or below a fixed epsilon after elimination are treated as exact zeros so floating cancellation does not invent phantom pivots or hide a true free column. Teachers and automated graders care about the non-finite rejection as much as the vectors: a cell that is not a finite number is not a matrix entry, and a silent coercion would hide that mistake.
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. Near-zero pivots after floating cancellation are dropped by the epsilon test so noise does not inflate rank on nearly dependent rows, which would shrink the reported kernel. Prefer this capability when you already have numeric rows and only need a kernel basis; if your source is a word problem, assemble the coefficient matrix first.
Round-trip checks are easy: multiply each returned basis vector by the original matrix and confirm a numerical zero, and confirm that dropping an independent row does not change the kernel while dropping a column can. Use related rank and reduced-row-echelon tools when you need those intermediate objects on their own landings.
What you can do with it
Homework checks for kernel bases
Students paste textbook coefficient rows and compare the special-solution basis, rank, and free columns against a deterministic result before submitting.
Pre-flight kernel checks in models and control
Pipelines assert that a design or constraint matrix has the expected nullity before solving homogeneous systems or inspecting unobservable directions.
FAQ
How is the null space basis computed here?
The tool reduces a working copy of the matrix to reduced row echelon form with partial pivoting, then builds one special solution per free column. Those vectors form a basis of ker(A).
What happens if an entry is not a finite number?
NaN, Infinity, empty cells, and non-numeric tokens are not matrix entries and are never billed.
What does an empty basis mean?
The kernel is trivial and nullity is zero.
Does this solve Ax = b for a nonzero right-hand side?
No. It returns a basis of the homogeneous kernel only. For a particular solution of an inhomogeneous system, use an augmented-matrix solver.
What is the nullity, and how does it relate to the rank?
The nullity is the number of vectors in the null space basis. The rank-nullity theorem says rank plus nullity equals the number of columns, so a matrix with 3 columns and rank 1 has nullity 2.
How can I check that a basis vector is right?
Multiply the original matrix by the vector: every row must give zero. For the vector (−2, 1, 0) and the row (1, 2, 3), the sum is −2 + 2 + 0, which is zero.
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/null-space \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"rows":[[1,2,3],[2,4,6]]}'const res = await fetch("https://api.kit.forhosting.com/math/null-space", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"rows": [
[
1,
2,
3
],
[
2,
4,
6
]
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/null-space",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"rows": [
[
1,
2,
3
],
[
2,
4,
6
]
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/null-space", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"rows":[[1,2,3],[2,4,6]]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"rows":[[1,2,3],[2,4,6]]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/null-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
{
"rows": [
[
1,
2,
3
],
[
2,
4,
6
]
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.null_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
Every entry must be a finite number — NaN, Infinity, and non-numeric tokens are rejected with invalid_input rather than silently coerced.
What the null space is and how a basis is built from RREF
For every free column j the algorithm builds one special solution: set the free variable x_j to one, set the other free variables to zero, and read the bound variables as the negated RREF entries in that free column. The published pivot_columns and free_columns let you assert the algorithm path in tests or worksheets without re-deriving the staircase by hand.
How to call the API and what comes back
Send a JSON body with one required field rows, with aliases matrix and A. The value must be a nested array of equal-length rows of finite numbers — for example two rows of three numbers each — so the web form can paint a row editor rather than a raw JSON box. 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 basis to an array of arrays, one kernel vector per free column in left-to-right order; nullity to the number of those vectors; rank to the pivot count; row_count and col_count to the dimensions; trivial to whether the kernel is only the origin; pivot_columns and free_columns to zero-based indices; and matrix to a rounded echo of the original. Failed validation — missing rows, empty rows, any non-finite entry, magnitudes above the limit, 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. Pair the response with your own plotter if you need a sketch of the kernel in R^2 or R^3; this endpoint returns the algebraic basis only and does not emit plots or step-by-step prose beyond the structured fields.
Practical tips, limits, and related searches
When teaching, pair examples: the classic two-by-three matrix with second row twice the first has rank one and a two-dimensional kernel spanned by minus two one zero and minus three zero one; the two-by-two identity has a trivial kernel and an empty basis; a two-by-two zero matrix has nullity two and the standard basis of the plane; and a cell such as a non-numeric token demonstrates the hard invalid_input path for an entry that is not a finite number. This landing targets people searching for a null space calculator, kernel of a matrix, or basis of ker A online; it is not a singular-value decomposition tool, not an eigenvalue solver, and not a particular-solution finder for Ax equals b. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send a non-finite cell.
Integration use cases
Unit tests for student linear-algebra code
Generate known-good trivial, one-dimensional, and higher-dimensional kernels plus deliberate non-finite rejections for coding kata expected values.
Technical questions
What does the null space calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.