Factors, GCD & LCM
Factorises an integer and computes GCD, LCM, divisors and primality for one or several numbers.
Splits a whole number into its prime factors and tells you the divisors, the divisor sum, Euler’s φ and the neighbouring primes. Give it several numbers instead and it computes the GCD and the LCM. The arithmetic is exact at any size, so numbers past 2^53 behave properly.
One number
Any size. Everything here is exact integer arithmetic, so numbers past 2^53 — where a spreadsheet stops telling consecutive integers apart — are handled properly.
Factorisation
360 = 2^3 × 3^2 × 5
prime?
no
digits
3
divisors
24
sum of divisors
1,170
Euler φ
96
coprimes below it
perfect?
no
equals the sum of its proper divisors
next prime
367
previous prime
359
Divisors (24)
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
Several numbers
greatest common divisor
6
least common multiple
5,040
One per line, or separated by commas.
How to use it
Type one number
Digits, optionally with commas. The factorisation, the divisors and the primality verdict all appear together.
Or several, for GCD and LCM
One per line or comma-separated. This is the panel you want for reducing a set of fractions or working out a repeat interval.
Read the neighbours when you need a prime
The next and previous primes are shown, which is what you are after when you want a prime near a particular size for a hash table or a modulus.
Common questions
Why did it refuse a large number?
Testing whether a number is prime is fast at any size; splitting it is the expensive direction. Pollard’s rho runs in roughly the fourth root of the number — milliseconds at twenty digits, many seconds past forty, in one call the browser cannot interrupt. Rather than freeze the tab, it stops and still tells you whether the number is prime.
Is 1 prime?
No, by definition — a prime has exactly two distinct divisors, and 1 has one. Excluding it is what makes prime factorisation unique, which is the whole reason the definition is drawn there.
What is Euler’s φ for?
It counts the numbers below n that share no factor with it. It is the size of the multiplicative group modulo n, which is what makes RSA work, and it is also the period of a repeating decimal 1/n when n is coprime to ten.
Feed it from
Fraction Calculator
Adds, subtracts, multiplies and divides fractions, reduces them and converts to and from decimals.
Big Number Calculator
Performs exact arithmetic on numbers far beyond 64 bits, including power, modulo and factorial.
Unit Converter
Converts length, weight, area, volume, temperature, speed, pressure and data units, including Korean units.
Number Base Converter
Converts between binary, octal, decimal, hexadecimal and any base up to 36, with bitwise views.
Next
These accept what this tool produces, so the result can go straight in.
Big Number Calculator
Performs exact arithmetic on numbers far beyond 64 bits, including power, modulo and factorial.
Fraction Calculator
Adds, subtracts, multiplies and divides fractions, reduces them and converts to and from decimals.
Number Base Converter
Converts between binary, octal, decimal, hexadecimal and any base up to 36, with bitwise views.
CSV Viewer
Opens a large delimited file with type detection, column stats and sorting, without loading it all into memory.
Currency Converter
Converts between about thirty currencies at the ECB’s daily reference rates, crossed through the euro, or at a rate you type in.
Date Difference
Counts days, weeks, months and years between two dates, with a D-day view and business-day option.