
Web Scripts & Software
DEV3 LCM, GCF & Prime Factorization Calculator — Source Code (React + Tailwind)
from $29
Live demoEveryday tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
Separate with commas, spaces or new lines.
All numbers are multiples of 6.
| Number | 2 | 3 | 5 |
|---|---|---|---|
| 12 | 2 | 1 | 0 |
| 18 | 1 | 2 | 0 |
| 30 | 1 | 1 | 1 |
| Highest (LCM) | 2 | 2 | 1 |
| Lowest (GCF) | 1 | 1 | 0 |
LCM = 2^2 x 3^2 x 5^1 = 180. GCF = 2^1 x 3^1 = 6.
Everything runs in your browser with exact big-integer arithmetic. Nothing is uploaded.
Need LCM, GCF & Prime Factorization Calculator as a full mobile or web app? We build it in about a week. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The lcm, gcf & prime factorization calculator stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Get the full app behind this tool. Buy once, own the source, and try each one live first.

Web Scripts & Software
from $29
Live demo
Web Scripts & Software Mobile app
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Web Scripts & Software
from $99
Live demo
Web Scripts & Software Mobile app
from $99
Live demo
Web Scripts & Software Mobile app
from $99
Live demo
Web Scripts & Software Mobile app
from $99
Live demoTeachers, students and fraction workers use the least common multiple (LCM) and greatest common factor (GCF, also called HCF or GCD) all the time. This calculator gives both for up to 20 numbers and shows the working in three ways.
All arithmetic uses arbitrary-size integers, so results are exact. Primality uses Miller-Rabin, and factorisation uses trial division followed by Pollard's rho. If a number is too hard to split within a fair time limit, the tool tells you instead of freezing.
For two numbers, GCF x LCM = a x b. A number with exponents e1, e2, and so on in its prime factorisation has (e1 + 1)(e2 + 1)... divisors. Two numbers are coprime when their GCF is 1.
The GCF (also called HCF or GCD) is the largest number that divides all your numbers exactly. The LCM is the smallest number that all of them divide into exactly. For 12 and 18 the GCF is 6 and the LCM is 36.
Write each number as a product of primes, then take every prime that appears and use its highest power. Multiply them together. For the GCF use only the primes shared by all numbers, each with its lowest power.
It finds the GCF of two numbers by repeated division: divide the larger by the smaller, replace the larger with the smaller and the smaller with the remainder, and stop when the remainder is zero. The last non-zero remainder is the GCF. The LCM then equals a x b / GCF.
It uses the Miller-Rabin test with 20 prime bases. Below about 3.3 x 10^24 the answer is mathematically certain; above that the chance of a wrong "prime" answer is smaller than one in a trillion.
It uses trial division and Pollard rho, which factors numbers with up to 35 digits or so when the second-largest prime factor is below about 10^14. If a number is too hard the tool says which part it could not split instead of guessing.
No. A prime has exactly two different divisors, 1 and itself, and 1 has only one. That is also why every whole number above 1 has exactly one prime factorisation.