ForHosting KIT · Math

2×2 matrix inverse calculator

For rows 4, 7 and 2, 6, the determinant is 10, the adjugate has rows 6, −7 and −2, 4, and dividing by 10 gives the inverse 0.6, −0.7, −0.2, 0.4. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Inverting a two-by-two matrix is one of the first closed-form linear-algebra skills students meet after determinants, and it reappears in graphics transforms, 2D least-squares, economics, and small-system solvers. This 2×2 matrix inverse calculator accepts a matrix [[a, b], [c, d]], computes det = ad − bc, builds the adjugate [[d, −b], [−c, a]], and returns A⁻¹ = (1/det) · adj(A) when the determinant is non-zero.

The 2×2 inverse formula: adjugate over determinant

For a real matrix A written as two rows [[a, b], [c, d]], the determinant is the scalar det(A) = ad − bc. That single number decides invertibility: if det is zero, the rows (and columns) are linearly dependent, the linear map collapses a direction, and no matrix B satisfies AB = BA = I. If det is non-zero, the inverse exists and has the famous closed form A⁻¹ = (1/det(A)) times the adjugate matrix.

The adjugate of a 2×2 matrix is obtained by swapping the main-diagonal entries a and d, and negating the off-diagonal entries b and c, which yields adj(A) = [[d, −b], [−c, a]]. Multiplying every entry of that adjugate by the reciprocal of the determinant produces the four numbers of A⁻¹. This is exactly the formula textbooks teach before Gauss–Jordan elimination on larger systems: four multiplications and a subtraction for the determinant, a swap-and-negate for the adjugate, and four divisions (or multiplications by 1/det) for the inverse.

The identity A · A⁻¹ = I is an algebraic consequence of that construction, not a separate numerical fit.

Where a 2 × 2 inverse comes in handy

Algebra courses and tutoring platforms need a 2×2 matrix inverse calculator that mirrors the adjugate formula students write on paper, not a general n×n Gauss–Jordan black box that hides the swap-and-negate step. Graphics and game notebooks often invert 2×2 blocks for 2D transforms, shear corrections, or covariance updates without pulling a full linear-algebra library. Economics and small econometric demos invert 2×2 Jacobians or substitution matrices in edge workers where cold-start size matters.

Keep requests small, pin the rounded inverse in tests, and you get reproducible A⁻¹ values for homework, grading, and production scripts without standing up symbolic or BLAS infrastructure of your own.

Classroom and homework checks

Let students enter [[a,b],[c,d]] and verify det, adjugate, and A⁻¹ against the textbook formula without sign errors on the off-diagonals.

Exam and LMS auto-grading

Mark 2×2 inverse items with a deterministic oracle that rejects singular matrices and returns stably rounded entries for comparison.

2D transforms and small systems

Invert 2×2 blocks in graphics, sensor, or econometric notebooks without importing a general matrix library.

What formula does this calculator use?

The closed-form adjugate-over-determinant formula for 2×2 matrices only—not Gauss–Jordan elimination used for general n×n inverses.

What happens if the matrix is singular?

If the determinant ad − bc is zero, no inverse exists, because the rows depend on each other. The calculator refuses the matrix with a clear message instead of inventing an inverse or switching to an approximation.

What is the adjugate of a 2 × 2 matrix?

Swap the two entries on the main diagonal and change the sign of the other two. For rows 4, 7 and 2, 6, the adjugate has rows 6, −7 and −2, 4; dividing it by the determinant gives the inverse.

How can I check the inverse by hand?

Multiply the original matrix by the inverse; the result must be the identity, with 1 on the diagonal and 0 elsewhere. For rows 4, 7 and 2, 6, the first entry is 4 times 0.6 plus 7 times −0.2, which is 1.

Where is a 2 × 2 inverse used?

In graphics transforms, two-dimensional least-squares fits, small economic models and systems of two equations with two unknowns. It is also the step students learn right after determinants, before Gauss-Jordan elimination on larger matrices.

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.

POSThttps://api.kit.forhosting.com/algebra/matrix-inverse-2x2

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.

curl -X POST https://api.kit.forhosting.com/algebra/matrix-inverse-2x2 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"matrix":[[4,7],[2,6]]}'
{
  "matrix": [
    [
      4,
      7
    ],
    [
      2,
      6
    ]
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.matrix_inverse_2x2",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

When the matrix is singular the task fails with invalid_input instead of inventing an inverse.

The 2×2 inverse formula: adjugate over determinant

This capability implements that textbook path only—no iterative refinement, no pseudoinverse for singular inputs—so classroom answers and API responses stay aligned with hand calculation.

Input contract, response shape, and singular rejection

Failed validation and singular rejections are not billed. POST a JSON body with a required matrix field: a nested array of exactly two rows, each with exactly two finite numbers, for example [[4, 7], [2, 6]]. Aliases a, A, mat, and rows are accepted for the same payload. An optional precision integer from 0 to 15 (default 12, aliases decimals and dp) controls how many decimal places appear on every returned entry. Each cell may arrive as a JSON number or a decimal string; non-finite values, wrong row counts, and non-numeric tokens fail with invalid_input naming the field. On success the body echoes matrix, the four scalars a, b, c, d, the determinant, the adjugate, the inverse, singular set to false, method adjugate_over_determinant, a short formula string, and the precision used. Example: [[4, 7], [2, 6]] has det = 24 − 14 = 10, adjugate [[6, −7], [−2, 4]], and inverse [[0.6, −0.7], [−0.2, 0.4]]. Pair the inverse with your own matrix–vector multiply if you need to solve Ax = b; this endpoint returns A⁻¹ only and does not solve linear systems or emit step-by-step prose beyond the formula field.

How do I compute the inverse of a 2×2 matrix?

Send matrix [[a, b], [c, d]]. The API returns A⁻¹ = (1/(ad−bc)) · [[d, −b], [−c, a]] when the determinant is non-zero, plus det and the adjugate.

What happens if the matrix is singular?

If det = ad − bc is zero (or numerically near zero), the task fails with invalid_input. A singular matrix has no inverse and the call is not billed.

Can I choose how many decimal places are returned?

Yes. Optional precision (aliases decimals, dp) is an integer from 0 to 15; the default is 12 decimal places on every numeric entry.

What does the 2×2 matrix inverse calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid or singular input is not billed.

Read the full KIT documentation →