Inverse Tangent Calculator

Inverse Matrix Calculator

An inverse matrix calculator finds A⁻¹, the matrix with A·A⁻¹ = I. Type a square matrix up to 8 × 8 to get the inverse in exact fractions with every Gauss–Jordan row operation, the determinant, a check and a diagram. It uses the 2 × 2 formula, the adjugate method and x = A⁻¹b for linear systems.

What is an Inverse Matrix?

The inverse of a square matrix A is the matrix A⁻¹ with A·A⁻¹ = A⁻¹·A = I, the identity matrix. For A = [[4, 7], [2, 6]], A⁻¹ = [[0.6, −0.7], [−0.2, 0.4]].

A · A⁻¹ = A⁻¹ · A = I
  • A⁻¹ exists exactly when det(A) ≠ 0. Such a matrix is called invertible or non-singular.
  • Only square matrices (n × n) can have an inverse.
  • Geometrically, A moves points and A⁻¹ moves them back. A 2 × 2 matrix maps the unit square to a parallelogram of area |det A|.
  • When det(A) = 0, A squashes the plane onto a line, and no matrix can undo that.

A matrix as a map

Move a, b, c and d. The square shows the unit square; the shaded shape is its image under A.

How to Find the Inverse of a 2×2 Matrix?

For A = [[a, b], [c, d]], swap a and d, change the signs of b and c, and divide by det = ad − bc.

A⁻¹ = 1/(ad − bc) · [[d, −b], [−c, a]]

For A = [[4, 7], [2, 6]]:

  1. det = 4 × 6 − 7 × 2 = 24 − 14 = 10.
  2. Swap and change signs: [[6, −7], [−2, 4]].
  3. Divide by 10: A⁻¹ = [[0.6, −0.7], [−0.2, 0.4]].

Check one entry of A·A⁻¹: row 1 times column 1 is 4 × 0.6 + 7 × (−0.2) = 2.4 − 1.4 = 1.

2 × 2 inverse, step by step

Type a, b, c and d.

How to Use This Inverse Matrix Calculator?

Type the matrix one row per line, and the calculator returns A⁻¹ in exact fractions with every row operation. The steps:

  1. Choose Any size for a matrix up to 8 × 8, 2 × 2 formula for 4 entries, or Solve Ax = b for a linear system.
  2. Type each row on its own line, with numbers split by spaces or commas. [[1, 2], [3, 4]] and 1 2; 3 4 work too.
  3. Read A⁻¹, the determinant, the check A·A⁻¹ = I and the condition number.
  4. Open the [A | I] diagram or the 2 × 2 geometry view, and the Gauss–Jordan steps.

When det(A) = 0, the calculator says which column has no pivot instead of giving an answer.

Try an example

Each button fills the calculator above and scrolls to the result.

How to Find the Inverse of a 3×3 Matrix (Gauss–Jordan)?

To invert a 3 × 3 matrix, write [A | I], use row operations to turn the left half into I, and read A⁻¹ from the right half.

  1. Write A next to the identity: [A | I].
  2. In column 1, get a 1 on the diagonal (swap rows or divide), then subtract multiples of that row to make the rest of the column 0.
  3. Repeat for columns 2 and 3.
  4. When the left half is I, the right half is A⁻¹.

For A = [[2, 1, 1], [1, 3, 2], [1, 0, 0]], 9 row operations give A⁻¹ = [[0, 0, 1], [−2, 1, 3], [3, −1, −5]]. The pivots multiply to det(A) = −1, with one sign flip for the row swap.

3 allowed operations: swap 2 rows, multiply a row by a non-zero number, and add a multiple of one row to another.

Gauss–Jordan, one column at a time

Type a square matrix, then step through the row operations.

Inverse by the Adjugate (Cofactor) Method

The adjugate formula is A⁻¹ = adj(A) / det(A), where adj(A) is the transpose of the cofactor matrix.

  1. Find det(A).
  2. Replace each entry by its minor: the determinant left after deleting its row and column.
  3. Apply the sign pattern + − + / − + − / + − +.
  4. Transpose (swap rows and columns) to get adj(A).
  5. Divide every entry by det(A).

The 2 × 2 formula is the adjugate method in miniature: adj([[a, b], [c, d]]) = [[d, −b], [−c, a]]. For 4 × 4 and larger, Gauss–Jordan takes far fewer steps.

Adjugate method, step by step

Type a square matrix with rows split by semicolons.

When Does a Matrix Have No Inverse?

A square matrix has no inverse when det(A) = 0: its rows (or columns) depend on each other, and A flattens space.

  • [[1, 2], [2, 4]]: row 2 is 2 × row 1, so det = 4 − 4 = 0.
  • Any matrix with a row or column of zeros is singular.
  • Any matrix with 2 equal rows is singular.
  • Non-square matrices have no inverse at all; they can have a one-sided or pseudo-inverse instead.

Near-singular matrices are risky in practice. As det(A) shrinks towards 0, the entries of A⁻¹ grow without bound, and small rounding errors in A swing the answer.

Approaching a singular matrix

Move k towards 4. The parallelogram flattens and the entries of A⁻¹ blow up.

Inverse Matrix Properties

The inverse reverses products, commutes with the transpose, and inverts the determinant.

  • (AB)⁻¹ = B⁻¹A⁻¹: undo the last step first, like taking off socks after shoes.
  • (Aᵀ)⁻¹ = (A⁻¹)ᵀ.
  • det(A⁻¹) = 1/det(A).
  • (A⁻¹)⁻¹ = A and (kA)⁻¹ = (1/k)A⁻¹ for k ≠ 0.
  • Diagonal matrices: invert each diagonal entry. diag(2, 5)⁻¹ = diag(1/2, 1/5).
  • Orthogonal matrices (rotations, reflections): A⁻¹ = Aᵀ.

In general A⁻¹B⁻¹ ≠ (AB)⁻¹, since matrix products depend on order.

Check the rules

Type 2 square matrices of the same size, rows split by semicolons.

Solving Linear Systems with an Inverse Matrix

A system Ax = b with det(A) ≠ 0 has exactly one solution, x = A⁻¹b.

For 2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3:

  1. A = [[2, 1, −1], [−3, −1, 2], [−2, 1, 2]] and b = (8, −11, −3).
  2. A⁻¹ = [[4, 3, −1], [−2, −2, 1], [5, 4, −1]].
  3. x = A⁻¹b = (4·8 + 3·(−11) + (−1)·(−3), …) = (2, 3, −1).

Solvers such as NumPy's linalg.solve skip forming A⁻¹ and eliminate on [A | b] directly; it is faster and more accurate. A⁻¹ pays off when the same A meets many different b vectors.

Solve Ax = b

Type A with rows split by semicolons, and b.

Inverse Matrix in Python, MATLAB and Excel

NumPy has np.linalg.inv(A), MATLAB has inv(A), Excel has MINVERSE and R has solve(A).

  • Python: np.linalg.inv(np.array([[4, 7], [2, 6]])) returns [[0.6, −0.7], [−0.2, 0.4]] in floating point.
  • SymPy: Matrix([[4, 7], [2, 6]]).inv() returns exact fractions.
  • MATLAB: inv(A) or A^-1; A\b solves a system without forming the inverse.
  • Excel and Google Sheets: =MINVERSE(A1:B2) spills the inverse into a 2 × 2 range; =MMULT(MINVERSE(A), b) solves a system.
  • Wolfram Language: Inverse[{{4, 7}, {2, 6}}].

The same inverse in code

Type a matrix, then pick a language. The code uses your numbers.

Common Matrices and Their Inverses

The table lists common 2 × 2 and 3 × 3 matrices with their exact inverses. Click a row to load the matrix into the calculator.

Patterns to spot: a diagonal matrix inverts entry by entry, a shear flips the sign of its off-diagonal entry, a rotation inverts to the opposite rotation, and an upper triangular matrix stays upper triangular.

Matrices and inverses

Filter by name or value, or click a row to send it to the calculator.

Matrix AA⁻¹
Identity I [1, 0] [0, 1][1, 0] [0, 1]
2 × 2 example [4, 7] [2, 6][3/5, −7/10] [−1/5, 2/5]
2 × 2 example [1, 2] [3, 4][−2, 1] [3/2, −1/2]
Diagonal [2, 0] [0, 5][1/2, 0] [0, 1/5]
Row swap [0, 1] [1, 0][0, 1] [1, 0]
Shear [1, 3] [0, 1][1, −3] [0, 1]
Rotation by 90° [0, −1] [1, 0][0, 1] [−1, 0]
Scaling by 2 [2, 0] [0, 2][1/2, 0] [0, 1/2]
Hilbert 2 × 2 [1, 1/2] [1/2, 1/3][4, −6] [−6, 12]
3 × 3 example [2, 1, 1] [1, 3, 2] [1, 0, 0][0, 0, 1] [−2, 1, 3] [3, −1, −5]
Upper triangular [1, 2, 3] [0, 1, 4] [0, 0, 1][1, −2, 5] [0, 1, −4] [0, 0, 1]

Inverse Matrices in Real Life

Inverse matrices undo transformations, decode messages and solve the linear systems behind graphics, engineering and economics.

  • Computer graphics: a camera or object transform is undone with its inverse. A rotation R(θ) has R(θ)⁻¹ = R(−θ) = R(θ)ᵀ.
  • Hill cipher: the key [[3, 3], [2, 5]] has det = 9, and 9⁻¹ mod 26 = 3, so the decoding key is [[15, 17], [20, 9]] mod 26.
  • Economics: the Leontief model finds production x = (I − A)⁻¹d for a demand d.
  • Circuits and structures: node voltages and member forces come from solving Ax = b.
  • Statistics: least squares uses (XᵀX)⁻¹Xᵀy for regression coefficients.

Undo a transformation

Pick an example and move the slider.

Inverse Matrix FAQ

What is the inverse of a matrix?

The matrix A⁻¹ with A·A⁻¹ = A⁻¹·A = I. It exists only for square matrices with det(A) ≠ 0.

How do you find the inverse of a 2×2 matrix?

For [[a, b], [c, d]], swap a and d, change the signs of b and c, and divide by ad − bc. [[4, 7], [2, 6]] gives [[0.6, −0.7], [−0.2, 0.4]].

How do you find the inverse of a 3×3 matrix?

Row reduce [A | I] to [I | A⁻¹] with Gauss–Jordan elimination, or compute adj(A)/det(A) from cofactors.

When does a matrix not have an inverse?

When det(A) = 0, or when the matrix is not square. Rows that depend on each other, such as row 2 = 2 × row 1, make det(A) = 0.

What is a singular matrix?

A square matrix with determinant 0. It has no inverse and flattens space onto a lower dimension.

Is A⁻¹ the same as 1/A?

No. Matrix division is not defined; A⁻¹ is the matrix that multiplies A to give I. Only 1 × 1 matrices behave like numbers.

What is (AB)⁻¹?

(AB)⁻¹ = B⁻¹A⁻¹, with the order reversed.

What is the determinant of an inverse matrix?

det(A⁻¹) = 1/det(A). For det(A) = 10, det(A⁻¹) = 0.1.

Can a non-square matrix have an inverse?

Not a 2-sided inverse. A tall or wide matrix can have a one-sided inverse or the Moore–Penrose pseudo-inverse.

How do I invert a matrix in Excel?

Select an n × n range and enter =MINVERSE(A1:C3). In older Excel, confirm with Ctrl+Shift+Enter.

How do I invert a matrix in Python?

np.linalg.inv(A) with NumPy, or Matrix(A).inv() with SymPy for exact fractions.

Why does the calculator show fractions?

It works in exact rational arithmetic, so 1/3 stays 1/3. The decimal form is listed under the result.

What is the inverse of the identity matrix?

The identity itself: I⁻¹ = I.

What is the inverse of a diagonal matrix?

Invert each diagonal entry: diag(2, 5)⁻¹ = diag(1/2, 1/5). It needs every diagonal entry to be non-zero.

What size of matrix can this calculator invert?

Up to 8 × 8, with exact fractions and every Gauss–Jordan step.