Your files stay on your device

# Primes, GCD, and LCM

Check if a number is prime, split it into factors, and find the GCD or LCM.
Prime?FactorNext primePrev primeRangeGCDLCMRunClear

Runs here in the tab · deterministic Miller-Rabin under ~3.3e24
Number

Enter a number and press Run.

- Primality: trial division, then Miller-Rabin. Below ~3.3×10²⁴ the base set is deterministic, the answer is a fact. Above it, 40 random rounds run and the answer says _probable_ prime, because that is what it is.
- Factorization: trial division, then Pollard's rho with a hard cap of 200,000 rounds. A number the cap cannot crack (typically a product of two large primes) refuses with the cap named. A wrong factor list would be worse. Every completed list is verified by multiplying back.
- Ranges sieve exactly (width ≤ 1,000,000 ); gcd/lcm are exact BigInt Euclid; lcm refuses a zero operand (meaningless by convention).
- Operands are digit strings up to 40 digits. Large work: sieves and factorizations past 10¹⁵, runs in the math family worker.

## More unit & math tools

- [Average and median](/converters/statistics)
- [Fraction calculator](/converters/fractions)
[All unit & math tools](/converters)

---

Canonical HTML: https://nutter.tools/converters/primes/
Markdown version: https://nutter.tools/converters/primes/index.md
Plain-text version: https://nutter.tools/converters/primes/index.txt
Agent index: https://nutter.tools/llms.txt

