Audited 29 Jul 2026·Last updated 31 Jul 2026·5 citations·Tier 2·0 uses

Matrix Power Calculator

Free matrix power calculator. Raise any square matrix up to 10×10 to a whole-number power from 0 to 20, with exact arithmetic and a worked A³ example.

Matrix Power Calculator

One row per line, entries separated by spaces or commas. Square only, max 10 × 10.
Whole number from 0 to 20. For a negative power use the matrix inverse calculator.
Aⁿ
[37 54; 81 118]
A multiplied by itself n times using the row-by-column matrix product, with semicolons between rows. This is not the entry-wise square: for A = [1 2; 3 4], A² is [7 10; 15 22], not [1 4; 9 16]. Negative and fractional exponents are not computed here — for A⁻¹ use the matrix inverse calculator.
Size (n × n)
2
Exponent applied
3
Trace of Aⁿ
155
Sum of entries
290

Background.

The Quanta matrix power calculator raises a square matrix to a whole-number power: enter the matrix one row per line and an exponent from 0 to 20, and it returns Aⁿ along with the matrix size, the trace of the result and the sum of its entries. Every multiplication in the chain is done in exact decimal arithmetic with no intermediate rounding, so an integer matrix raised to an integer power comes back as exact integers rather than as values that have drifted through twenty rounds of floating point.

The first thing to be clear about is what Aⁿ means, because there is a trap here that catches people constantly. A matrix power is repeated matrix multiplication — the row-by-column product — not the entry-wise square. For A = [1 2; 3 4], A² is [7 10; 15 22], because the top-left entry is 1·1 + 2·3 = 7. It is not [1 4; 9 16], which is what you get by squaring each entry individually; that is the Hadamard square and it is a different matrix with different meaning. Spreadsheet formulas and array languages often default to the entry-wise version, which is exactly why the confusion is so common.

The second is the shape requirement. Only a square matrix can be raised to a power, because A·A only exists when the number of columns of A equals the number of rows of A. A 2 × 3 matrix has no square, no cube and no nth power at all. The calculator checks this before doing anything and prints the shape it found, so a rectangular paste fails loudly rather than producing something plausible-looking.

The scope of this page is deliberately narrow, and worth stating up front. The exponent must be a non-negative whole number. A negative power means the inverse — A⁻ⁿ is (A⁻¹)ⁿ, which only exists when A is invertible — and that belongs on the matrix inverse calculator, linked below. A fractional power means a matrix root, which is not unique (a matrix can have several square roots, or none at all among real matrices), and neither that nor the matrix exponential is computed anywhere on this site. A⁰ is defined here as the identity matrix of the same size, for every square matrix including the zero matrix and every singular one. That is the empty-product convention, adopted so that the exponent law AⁿAᵐ = Aⁿ⁺ᵐ holds without exceptions; it is a convention this page states, not a fact borrowed from a source.

Matrix powers matter far beyond exam questions. In a Markov chain, the transition matrix raised to the nth power gives the n-step transition probabilities, and the row sums stay equal to 1 forever — a property you can watch on this page, because the sum-of-entries output stays equal to the number of rows at every exponent. In graph theory, if A is the adjacency matrix of a graph, then the (i, j) entry of Aⁿ is the number of walks of length n from vertex i to vertex j, so the trace of Aⁿ counts closed walks of that length. In numerical analysis, the powers of an iteration matrix decide whether an iterative solver converges. And the classic identity behind fast Fibonacci computation is a matrix power: raising [1 1; 1 0] to the nth power lays the Fibonacci numbers out in its entries, which is exactly the check used to validate this calculator.

One practical note. Entries of Aⁿ grow roughly geometrically with n, so the calculator caps the exponent at 20 and refuses any result whose entries exceed 10¹⁰⁰ — a hundred-digit number in the answer panel is not a useful answer.

What is matrix power calculator?

A matrix power is the result of multiplying a square matrix by itself a whole number of times, using the ordinary row-by-column matrix product. Formally, A⁰ = I, the identity matrix of the same size, and Aⁿ = A·Aⁿ⁻¹ for every integer n ≥ 1. Only square matrices have powers: the product A·A requires the number of columns of A to equal the number of rows of A, which is the definition of square. The size never changes — if A is n × n then every power of A is also n × n — which is exactly the opposite of ordinary matrix multiplication, where multiplying differently shaped factors usually changes the shape of the answer. The key distinction to keep hold of is that this is the Cayley product iterated, not entry-wise exponentiation. Encyclopedia of Mathematics distinguishes Cayley multiplication from Hadamard (entry-wise) multiplication in a single article, and the two give completely different powers: the Cayley square of [1 2; 3 4] is [7 10; 15 22] while the Hadamard square is [1 4; 9 16]. Powers obey the exponent laws you would expect within their domain: AⁿAᵐ = Aⁿ⁺ᵐ and (Aⁿ)ᵐ = Aⁿᵐ for non-negative integers n and m. They do not obey (AB)ⁿ = AⁿBⁿ, because matrix multiplication is not commutative — that identity holds only when A and B commute. Powers are also intimately tied to eigenvalues: if A has eigenvalue λ with eigenvector v, then Aⁿ has eigenvalue λⁿ with the same eigenvector, which is why the trace of Aⁿ equals the sum of the nth powers of the eigenvalues and why the long-run behaviour of Aⁿ is governed by the eigenvalue of largest magnitude. The Cayley–Hamilton theorem — "every square matrix satisfies its own characteristic equation", as Encyclopedia of Mathematics states it — adds a further constraint: every power beyond the (n−1)th can be written as a combination of I, A, …, Aⁿ⁻¹, which for a 2 × 2 gives the compact identity A² = tr(A)·A − det(A)·I.

How to use this calculator.

  1. Type the matrix into the first box, one row per line, entries separated by spaces or commas. It must be square — the same number of rows as columns — because a rectangular matrix has no power at all.
  2. Set the exponent. Any whole number from 0 to 20 works. Zero returns the identity matrix, one returns the matrix itself, and the ceiling of 20 is there because entries grow geometrically and a hundred-digit answer is not a useful answer.
  3. Read Aⁿ in the hero panel, with semicolons separating rows. [37 54; 81 118] means the first row is 37 54 and the second is 81 118.
  4. Check the trace and the sum of entries. For a row-stochastic (Markov) matrix, the sum of entries should stay equal to the number of rows at every exponent — if it drifts, the matrix you typed was not stochastic.
  5. To verify a 2 × 2 square by hand, use Cayley–Hamilton: A² should equal tr(A)·A − det(A)·I. For [1 2; 3 4] the trace is 5 and the determinant is −2, so A² = 5A + 2I = [7 10; 15 22], which is what the calculator returns.
  6. If you need a negative power, compute A⁻¹ on the matrix inverse calculator first, then bring that matrix back here and raise it to the positive power — A⁻ⁿ is exactly (A⁻¹)ⁿ.

The formula.

A⁰ = I, Aⁿ = A · Aⁿ⁻¹

A matrix power is defined recursively: A⁰ is the identity matrix I, and for n ≥ 1, Aⁿ is A multiplied by Aⁿ⁻¹ using the ordinary matrix product, whose (i, j) entry is the sum over k of the products of row i of the left factor with column j of the right. The calculator implements this literally, starting from the identity and multiplying by A exactly n times, which means n − 1 matrix products for n ≥ 1 and none at all for n = 0. Exponentiation by squaring would use fewer products, but with the exponent capped at 20 and the size at 10 × 10 the saving is measured in microseconds, and since the arithmetic is exact, associativity holds exactly and both schemes would return identical digits. Work through the example. A = [1 2; 3 4]. Squaring: the top-left entry of A² pairs row 1 of A, (1, 2), with column 1 of A, (1, 3), giving 1·1 + 2·3 = 7; the top-right pairs (1, 2) with (2, 4), giving 2 + 8 = 10; the bottom-left pairs (3, 4) with (1, 3), giving 3 + 12 = 15; the bottom-right pairs (3, 4) with (2, 4), giving 6 + 16 = 22. So A² = [7 10; 15 22]. Cubing multiplies that by A again: 7·1 + 10·3 = 37, 7·2 + 10·4 = 54, 15·1 + 22·3 = 81, 15·2 + 22·4 = 118, giving A³ = [37 54; 81 118]. Rounding is done exactly once, at the very end. Every product in the chain is accumulated as an exact decimal value with no intermediate rounding, and only the finished entries of Aⁿ are rounded to ten decimal places for display. This matters more here than on any other page in this family: an error introduced at step two is amplified by every subsequent multiplication, so a floating-point implementation of A²⁰ can be visibly wrong in the last digits even for small integer inputs. Two structural facts are worth knowing. First, eigenvalues raise to the same power: if Av = λv then Aⁿv = λⁿv, so the eigenvalues of Aⁿ are exactly the nth powers of the eigenvalues of A. That is why the trace output, which is the sum of the diagonal of Aⁿ, equals the sum of the nth powers of the eigenvalues of A. Second, Cayley–Hamilton says every square matrix satisfies its own characteristic equation, which for a 2 × 2 reduces to A² = tr(A)·A − det(A)·I — a completely independent route to the same square, and a good way to check a hand calculation.

A worked example.

Example

A is the 2 × 2 matrix [1 2; 3 4] and the exponent is 3, so the size output is 2 and the exponent output is 3. The calculator multiplies A by itself twice. First the square: the top-left entry is 1·1 + 2·3 = 7, the top-right is 1·2 + 2·4 = 10, the bottom-left is 3·1 + 4·3 = 15, and the bottom-right is 3·2 + 4·4 = 22, so A² = [7 10; 15 22]. That intermediate matrix can be checked independently with Cayley–Hamilton, which for a 2 × 2 gives A² = tr(A)·A − det(A)·I; here the trace is 1 + 4 = 5 and the determinant is 1·4 − 2·3 = −2, so tr(A)·A − det(A)·I = 5·[1 2; 3 4] + 2·[1 0; 0 1] = [5 10; 15 20] + [2 0; 0 2] = [7 10; 15 22] — the same matrix. Then the cube: multiplying [7 10; 15 22] by [1 2; 3 4] gives 7·1 + 10·3 = 37, 7·2 + 10·4 = 54, 15·1 + 22·3 = 81 and 15·2 + 22·4 = 118. So the power output is [37 54; 81 118]. The traceOfPower output is the sum of the main diagonal, 37 + 118 = 155, and the sumOfEntries output is 37 + 54 + 81 + 118 = 290. Set the exponent to 0 with the same matrix and the power output becomes [1 0; 0 1], the 2 × 2 identity, with traceOfPower 2 and sumOfEntries 2 — the empty-product convention in action. Set it to 1 and you get [1 2; 3 4] straight back.

matrix A1 2 3 4
exponent3

Frequently asked questions.

How do you raise a matrix to a power?
Multiply it by itself, using ordinary matrix multiplication, as many times as the exponent says. A² = A·A, A³ = A·A·A, and so on. Each multiplication is row-by-column: the entry in row i, column j of the product comes from row i of the left factor and column j of the right. A⁰ is defined to be the identity matrix. The matrix must be square, because A·A only exists when the number of columns equals the number of rows.
Is A² the same as squaring each entry?
No, and this is the single most common mistake with matrix powers. A² means the matrix product A·A. For A = [1 2; 3 4], that gives [7 10; 15 22]. Squaring each entry individually gives [1 4; 9 16], which is called the Hadamard square and is a different matrix representing a different operation. Encyclopedia of Mathematics lists Cayley and Hadamard multiplication in the same article precisely because the two are so easily confused. This calculator computes the Cayley power.
Why does A⁰ equal the identity matrix?
By the empty-product convention, the same reason x⁰ = 1 for ordinary numbers: a product of no factors is the multiplicative identity, and for matrices that is I. The reason to adopt it is that it makes the exponent law AⁿAᵐ = Aⁿ⁺ᵐ hold in every case — with A⁰ = I, A⁰A³ = IA³ = A³ = A⁰⁺³, which is what you want. This calculator applies the convention to every square matrix, including the zero matrix and every singular matrix, and states it as a convention rather than attributing it to a source.
Can I raise a non-square matrix to a power?
No. A·A requires the number of columns of A to equal the number of rows of A, which is exactly the condition for A to be square. A 2 × 3 matrix cannot be multiplied by itself in either order, so it has no square and no higher power. The calculator checks the shape before doing anything and tells you what shape it found. If you want a square matrix built from a rectangular one, AᵀA and AAᵀ are both square — see the matrix transpose calculator.
How do I compute a negative matrix power?
A⁻ⁿ means (A⁻¹)ⁿ, the nth power of the inverse, and it exists only when A is invertible — that is, when its determinant is not zero. This page does not compute it. Find A⁻¹ on the matrix inverse calculator, copy the result, and raise that to the positive power here. The two-step route is deliberate: inversion can fail, and it should fail on the page that explains why, with the determinant shown beside the answer.
What is the matrix power used for in Markov chains?
If P is the one-step transition matrix of a Markov chain, then Pⁿ is the n-step transition matrix: its (i, j) entry is the probability of being in state j after n steps given that you started in state i. Because every row of P sums to 1, every row of Pⁿ also sums to 1 for every n — you can watch this on the calculator, since the sum-of-entries output for a row-stochastic matrix stays equal to the number of rows at every exponent. As n grows, Pⁿ often converges to a matrix whose rows are all the stationary distribution.
What does the trace of Aⁿ tell me?
Two useful things. Algebraically, the trace of Aⁿ equals the sum of the nth powers of the eigenvalues of A, because raising a matrix to a power raises each eigenvalue to that power while leaving the eigenvectors alone. Combinatorially, if A is the adjacency matrix of a graph then the (i, j) entry of Aⁿ counts the walks of length n from vertex i to vertex j, so the trace — the diagonal sum — counts the closed walks of length n. That is a standard result of graph theory rather than something taken from the sources cited on this page.
How does the Fibonacci matrix identity work?
Take Q = [1 1; 1 0]. Then Qⁿ has the Fibonacci numbers in its entries: the top-left is F(n+1), both off-diagonal entries are F(n), and the bottom-right is F(n−1). At n = 10 that predicts [89 55; 55 34], since F₉ = 34, F₁₀ = 55 and F₁₁ = 89 — and that is exactly what this calculator returns, which is the independent check used to validate it. It is also the basis of fast Fibonacci algorithms: raising Q to the nth power by repeated squaring computes F(n) in about log n multiplications instead of n additions.
Why is the exponent limited to 20?
Because entries grow roughly geometrically. Multiplying an integer matrix by itself repeatedly can add several digits per step, so a modest 3 × 3 raised to the 40th power can have entries with dozens of digits, which is unreadable in an answer panel and not what anyone came for. The calculator also refuses any result whose entries exceed 10¹⁰⁰ even within the 20-step limit. The arithmetic itself is exact throughout — the caps are about the answer staying legible, not about precision running out.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 977 calculators remain free
  • No billing is enabled
Coming soon