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
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 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.
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.
Frequently asked questions.
How do you raise a matrix to a power?
Is A² the same as squaring each entry?
Why does A⁰ equal the identity matrix?
Can I raise a non-square matrix to a power?
How do I compute a negative matrix power?
What is the matrix power used for in Markov chains?
What does the trace of Aⁿ tell me?
How does the Fibonacci matrix identity work?
Why is the exponent limited to 20?
References& sources.
- [1]Encyclopedia of Mathematics (EMS Press / Springer), article "Matrix" — the row-by-column product AB = (c_{μν}) with c_{μν} = Σ_j a_{μj} b_{jν}, which a matrix power iterates. Retrieved 2026-07-29; open access.
- [2]Encyclopedia of Mathematics (EMS Press / Springer), article "Cayley–Hamilton theorem" — "every square matrix satisfies its own characteristic equation", the identity behind the 2 × 2 check A² = tr(A)·A − det(A)·I used on this page. Retrieved 2026-07-29; open access.
- [3]Encyclopedia of Mathematics (EMS Press / Springer), article "Matrix multiplication" — distinguishes Cayley multiplication from Hadamard (entry-wise) multiplication, the distinction behind "A² is not the entry-wise square". Retrieved 2026-07-29; open access.
- [4]NIST Digital Library of Mathematical Functions, §1.3(iv) "Matrices as Linear Operators" — the operator view in which Aⁿ is the n-fold composition of a linear map with itself. Retrieved 2026-07-29; open access.
- [5]MIT OpenCourseWare 18.06 Linear Algebra, Spring 2010, Prof. Gilbert Strang — lectures on powers of a matrix, eigenvalues, Markov matrices and the long-run behaviour of Aⁿ. CC BY-NC-SA 4.0; retrieved 2026-07-29; open access.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled