On this page
Schoolbook long multiplication of two n-digit numbers multiplies every digit of one by every digit of the other, so it needs n² single-digit products. Andrey Kolmogorov conjectured that nothing could do fundamentally better. Karatsuba's trick shows that you can, and the whole idea fits in one line of algebra.
What is Karatsuba multiplication?
Karatsuba multiplication is a divide-and-conquer method that multiplies two n-digit numbers using three multiplications of half the size, where the obvious split needs four. According to the history in the Karatsuba algorithm article, Kolmogorov stated his conjecture that about n² operations were unavoidable at a 1960 seminar at Moscow State University, and Anatoly Karatsuba, then a 23-year-old student, found a faster method within a week. It was published in 1962 under the names A. Karatsuba and Yu. Ofman in the Proceedings of the USSR Academy of Sciences (Doklady), as the reference list of Schönhage and Strassen's 1971 paper records.
Here is the idea. Write the two numbers as x = a·B + b and y = c·B + d, where B is a power of 10 that splits each number in half. Then
x·y = ac·B² + (ad + bc)·B + bd
That looks like four products: ac, ad, bc and bd. But you never need ad and bc separately, only their sum, and
(a + b)(c + d) − ac − bd = ad + bc
So three products are enough: ac, bd and (a + b)(c + d). The extra additions and subtractions cost steps proportional to n, not n².
How does Karatsuba multiply 1234 × 5678?
Take B = 100, so a = 12, b = 34, c = 56 and d = 78.
ac = 12 × 56 = 672
bd = 34 × 78 = 2652
(a + b)(c + d) = 46 × 134 = 6164
ad + bc = 6164 − 672 − 2652 = 2840
Assemble: 672 × 10,000 + 2840 × 100 + 2652 = 6,720,000 + 284,000 + 2,652 = 7,006,652
Check step 4 the slow way: 12 × 78 + 34 × 56 = 936 + 1904 = 2840.
Now apply the same trick to each smaller product. For 12 × 56, split with B = 10: 1 × 5 = 5, 2 × 6 = 12, and (1 + 2)(5 + 6) = 33, so the middle term is 33 − 5 − 12 = 16 and the product is 500 + 160 + 12 = 672. The recursion keeps going until the pieces are small enough to multiply directly.
Why is Karatsuba O(n^1.585)?
Let T(n) be the cost of multiplying two n-digit numbers. One Karatsuba step makes three calls of size n/2 plus linear work for the additions, so T(n) = 3T(n/2) + O(n). This is exactly the kind of recurrence the master theorem for divide-and-conquer recurrences solves.
You can also see it by unrolling. At depth k there are 3^k subproblems, each of size n/2^k. The tree has log₂ n levels, so the bottom level holds 3^(log₂ n) = n^(log₂ 3) small products. Since log₂ 3 ≈ 1.585, the cost grows like n^1.585. The GMP manual's Karatsuba page states the same: Karatsuba is asymptotically O(N^1.585), the exponent being log(3)/log(2), because it does 3 multiplies each half the size of the inputs.
To feel the gap, take n = 1024 = 2^10 digits. Schoolbook needs 1024² = 1,048,576 digit products; full Karatsuba recursion needs about 3^10 = 59,049. If the comparison of growth rates is new to you, our explainer on Big O notation and growth rates builds it up from scratch.
When do faster methods like FFT take over?
For small numbers, Karatsuba's extra additions cost more than they save. The GMP manual's list of multiplication algorithms names seven methods used as size grows: basecase (schoolbook), Karatsuba, Toom-3, Toom-4, Toom-6.5, Toom-8.5 and FFT. Its Karatsuba page says the switch-over point can be as little as 10 limbs (a limb is one machine word).
At very large sizes, GMP uses an FFT multiplication following Schönhage and Strassen, and its FFT multiplication page says that in practice the threshold has been found somewhere between 3000 and 10000 limbs. FFT methods treat the digits as coefficients of a polynomial and multiply by convolution, the same link between convolution and the DFT covered in our post on circulant matrices and the DFT.
The best bound known today was published in 2021: David Harvey and Joris van der Hoeven gave an algorithm that multiplies two n-bit integers in O(n log n) bit operations, confirming a conjecture Schönhage and Strassen made in 1971, as their Annals of Mathematics paper states in its abstract.
How do you practise Karatsuba by hand?
Pick two 4-digit numbers and split each at the middle.
Compute ac, bd and (a + b)(c + d), then subtract to get the middle term.
Recurse once on one of the 2-digit products.
Check the middle term with ad + bc computed directly.
Count your small products and compare with the 16 digit products schoolbook needs.
If the recurrence or the identity is the part that feels shaky, the Fermi Concept Library covers the underlying ideas across mathematics and computing. And when a worked problem goes wrong, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.



