Determinant calculator
The 2×2 matrix with rows (4, 3) and (6, 3) has a determinant of −6, so it can be inverted. Any square matrix up to 32×32 gets its determinant and a clear note on whether it is singular. 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.
det(A) of a square matrix, free online
What a determinant tells you
The determinant is one number that summarizes a square matrix, and it shows up everywhere linear algebra does. A non-zero determinant means the matrix is invertible: the linear system it defines has exactly one solution, the transformation it represents preserves dimension, and its columns are linearly independent. A determinant of zero means the matrix is singular — the system has no solution or infinitely many, and the transformation collapses space onto a lower-dimensional flat.
The sign of the determinant tells you whether the transformation flips orientation, and its absolute value is the factor by which areas, volumes or their n-dimensional analogues are scaled. That is why determinants appear in change-of-variables formulas in calculus, in the Jacobian of a multivariable transformation, in Cramer's rule for solving small systems, and in the characteristic polynomial whose roots are the eigenvalues.
When you feed a matrix to this determinant calculator, you get that single decisive number without having to carry out an error-prone cofactor expansion by hand, and the response also flags explicitly whether the matrix is singular so your code can branch on it instead of comparing a float to zero yourself.
How the computation works
For anything beyond a 2x2 matrix, hand methods such as cofactor expansion grow factorially with the dimension, so this capability uses the algorithm every numerical library relies on: Gaussian elimination with partial pivoting. The matrix is reduced to upper-triangular form row by row; at each step the largest available entry in the current column is chosen as pivot and rows are swapped if needed.
Each swap flips the sign of the determinant, and once the matrix is triangular the determinant is simply the product of the diagonal entries, corrected by that sign. Partial pivoting is not a cosmetic detail — it keeps the arithmetic numerically stable when pivots would otherwise be tiny, which is exactly the situation where naive elimination produces garbage. The result is rounded to twelve significant digits so the output is byte-identical across machines and runtimes.
Entries are validated before any arithmetic happens: every value must be a finite number, numeric strings are accepted, and the matrix must be non-empty, square and at most 32x32.
What you can do with it
Check invertibility before solving
Test det(A) != 0 before committing to a solve or an inverse, so singular systems fail fast with a clear signal instead of a division by zero deep in your pipeline.
Jacobian scaling in coordinate changes
Compute the determinant of a Jacobian matrix to get the local area or volume scaling factor for a change of variables in integration or simulation code.
Homework and teaching checks
Verify hand-computed determinants of 2x2 and 3x3 matrices instantly, and show students the elimination method and row-swap count behind the result.
FAQ
What input format does it expect?
The matrix must be square, non-empty and at most 32x32.
What happens if the matrix is not square?
Every row must have exactly as many entries as there are rows.
How accurate is the result?
The computation uses Gaussian elimination with partial pivoting, the standard numerically stable approach, and the output is rounded to twelve significant digits so results are identical across machines.
Can I pass numbers as strings?
Yes. Numeric strings like "3.5" are accepted and parsed.
What does it mean if the determinant is zero?
A determinant of zero means the matrix is singular: it has no inverse, its system of equations has either no solution or infinitely many, and it flattens space onto fewer dimensions. Any other value means exactly one solution.
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/determinant \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"matrix":[[4,3],[6,3]]}'const res = await fetch("https://api.kit.forhosting.com/math/determinant", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"matrix": [
[
4,
3
],
[
6,
3
]
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/determinant",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"matrix": [
[
4,
3
],
[
6,
3
]
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/determinant", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"matrix":[[4,3],[6,3]]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"matrix":[[4,3],[6,3]]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/determinant", 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": [
[
4,
3
],
[
6,
3
]
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.determinant",
"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_mb | 1 |
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
The determinant API computes det(A) for any square matrix you send as rows of numeric entries. It accepts a nested JSON array, validates that the matrix is square and that every entry is a finite number, and returns the determinant together with the dimension, a singular-matrix flag and the method used. It runs the same deterministic Gaussian-elimination code in your browser for free and on the API edge for automation, so a quick manual check and a production pipeline always agree on the result down to the last digit.
How the computation works
Non-square or non-numeric input is rejected with an invalid_input error and is never billed.
Using it from the API
Send one field, matrix, as a nested array of rows — or as a JSON string of the same shape, which is convenient when your toolchain passes everything as text. The response gives you the determinant, the dimension n, the normalized matrix as it was parsed, a boolean is_singular flag, the method identifier and the number of row swaps performed during elimination, which is useful when you want to audit why the sign came out the way it did. Because the engine is a pure parse with no network calls, no model inference and no file I/O, latency is dominated by transport, not computation, and the pricing reflects that: $0.002 per request, with matrices capped at 32x32 which is far beyond what classroom, graphics and most engineering workloads need. For repeated work, batch your matrices in a loop on your side; each request is stateless and independent.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page, with identical results.
How do I know if the matrix is singular?
Check the is_singular flag in the response. It is true exactly when the determinant is zero, meaning the matrix has no inverse.