Z Number Theory

Number Theory Visualizer

See the math behind algorithms, step by step

Free No signup Runs in your browser

Number theory underpins cryptography, hashing and countless interview problems. These visualizers make the classic procedures tangible — watch the sieve cross out composites, the Euclidean algorithm shrink two numbers to their GCD, or the Collatz orbit bounce toward 1.

Browse Visualizers

Frequently asked questions

How does the Sieve of Eratosthenes work?

Starting from 2, it marks every multiple of each prime as composite; whatever stays unmarked is prime. It finds all primes up to n in about O(n log log n).

Why is the Euclidean algorithm so fast?

Each step replaces the larger number with the remainder of dividing the two, shrinking values quickly — O(log min(a, b)) time, only a handful of steps even for huge numbers.