🧮
🧮 Math & statistics

Matrix Power Calculator (Aⁿ)

Results update as you type.

Your numbers

Understanding the matrix power calculator — concept and principle

This calculator raises a square matrix to a whole-number power, Aⁿ = A·A·…·A (n factors), with A⁰ = I. Matrix powers describe what happens when the same linear step is repeated: a Markov chain after n transitions, a population model after n years, the number of walks of length n in a graph (from its adjacency matrix), or a linear recurrence such as the Fibonacci sequence.

Computing A¹⁰ for A = [1 1; 1 0]10 = 8 + 2. Square A three times to get A², A⁴, A⁸, then A¹⁰ = A⁸ × A² = [89 55; 55 34].A¹⁰ by repeated squaring10 = 8 + 2 =18041201binaryA1110A²2111A⁴5332A⁸34212113each arrow: square itA⁸ × A² =89555534= A¹⁰Fibonacci numbers3 squarings + 1 product = 4 steps, not 9
Write n in binary, square repeatedly, and multiply only the powers whose bit is 1.

How it is calculated

Instead of multiplying by A n − 1 times, the calculator uses repeated squaring (exponentiation by squaring). Write n in binary. Keep a running result P = I and a base B = A. At each step, if the current lowest bit of n is 1, multiply P by B; then square B and shift n one bit to the right. When n reaches 0, P = Aⁿ. This needs about log₂ n squarings plus at most as many extra products, so A¹⁰⁰⁰ costs roughly 20 matrix multiplications instead of 999. The power must be a whole number 0 or larger and the matrix must be square.

The principle

Powers add when you multiply: Aᵃ·Aᵇ = Aᵃ⁺ᵇ. Any n is a sum of powers of two (its binary digits), and A, A², A⁴, A⁸, … are obtained by squaring the previous one. Multiplying together only the ones that match the 1-bits of n gives Aⁿ. For the default matrix there is a neat bonus: [1 1; 1 0]ⁿ = [Fₙ₊₁ Fₙ; Fₙ Fₙ₋₁], where Fₖ are the Fibonacci numbers (F₁ = F₂ = 1). This follows by induction, because multiplying by [1 1; 1 0] adds the two entries of each row, exactly the Fibonacci rule Fₖ₊₁ = Fₖ + Fₖ₋₁.

Worked example

  1. Defaults: A = [1 1; 1 0], n = 10. In binary, 10 = 1010₂ = 8 + 2.
  2. Squaring: A² = [2 1; 1 1], A⁴ = [5 3; 3 2], A⁸ = [34 21; 21 13].
  3. Multiply the pieces for the 1-bits: A¹⁰ = A²·A⁸ = [2·34 + 1·21, 2·21 + 1·13; 1·34 + 1·21, 1·21 + 1·13].
  4. Result: A¹⁰ = [89 55; 55 34], which is [F₁₁ F₁₀; F₁₀ F₉].

How to read the result

The long-run behaviour of Aⁿ is governed by the eigenvalues of A. If every eigenvalue has absolute value below 1, the entries shrink toward 0; if one is larger than 1, they grow roughly like λⁿ. Here the largest eigenvalue is the golden ratio φ ≈ 1.618, so the entries grow by about 1.618 each step (89/55 ≈ 1.618). For a transition matrix, the largest eigenvalue is 1 and the rows of Aⁿ often approach the steady state.

Common mistakes

Keep in mind: Entries can grow very fast. Beyond about 2⁵³ (≈ 9 × 10¹⁵), floating-point numbers can no longer represent every integer exactly, so large integer powers lose their last digits.

Frequently asked questions

What is A⁰?

The identity matrix of the same size, by definition.

How do I get A⁻ⁿ?

Invert A first (if det ≠ 0) and then raise the inverse to the power n.

Is there a faster way for very large n?

If A is diagonalizable as A = PDP⁻¹, then Aⁿ = PDⁿP⁻¹, where Dⁿ just raises each eigenvalue to the n-th power.

Sources: Donald E. Knuth, The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, section 4.6.3 (evaluation of powers) · Gilbert Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press — diagonalization and powers Aᵏ

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →