AlgoScope

Karatsuba Multiplication

AlgorithmadvancedDivide and Conquer

Multiply n-digit numbers with three half-size products instead of four.

Decision · step 3 of 4Karatsuba and Strassen: Karatsuba: 1234 x 5678 with three products
highlowxyz2 = a cz0 = b d(a+b)(c+d)z1x y12345678672✓2652✓46 x 13461646164 - 672 - 26522840

The middle term needs a d + b c. Instead of two products, multiply the sums once: (12 + 34) x (56 + 78) = 46 x 134 = 6164, which expands to a c + a d + b c + b d. Subtract the two products already known, 672 and 2652, and what remains is exactly a d + b c: z1 = 2840. Three multiplications, not four.

Open in the player →or start at step 3

What you will see

Digits split in halves; three recursive products combine with shifts.

How karatsuba and strassen works →

Cost

BestO(n^1.585)
AverageO(n^1.585)
WorstO(n^1.585)
SpaceO(n)

Exponent is log2(3).

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input.

Screen readers: Each call frame announces its range and result; each step announces split, recurse or combine.

Reduced motion: Frames appear and disappear with crossfades; ranges highlight without motion.

Taught by the same lesson

Karatsuba and Strassen covers these too, in the same run.