arrow_backAll Calculators/Mathematics & Probability/Prime Factorization, GCD & LCM Calculator
tag
doomath Calculator

Prime Factorization, GCD & LCM Calculator

Find Greatest Common Divisor (GCD/HCF), Least Common Multiple (LCM), and prime factor decomposition using the Euclidean division algorithm.

InputsChange a value to recalculate instantly
ResultUpdates as you type
GCD / HCF6
LCM420
A prime factors2 × 2 × 3 × 7
B prime factors2 × 3 × 5
FORMULA & STEPSPrime Factorization, GCD & LCM Calculator — Mathematical Derivation & Steps
2 StepsSequential Calculation Breakdown
1
Prime factorization
Break each integer into prime factors.
2
Euclidean GCD
Repeated remainders reduce the pair to the greatest common divisor.
λ DooMathWork with this calculation
Local · deterministic · optional
auto_awesome
Quick mathNatural-language-style shortcuts for deterministic arithmetic.
Calculator guide

How to use the Prime Factorization, GCD & LCM Calculator

Find Greatest Common Divisor (GCD/HCF), Least Common Multiple (LCM), and prime factor decomposition using the Euclidean division algorithm.

01Set inputsChoose values, units and assumptions.
02Apply the modelGCD(A, B) via A = qB + r; LCM(A, B) = |A × B| / GCD(A, B); Canonical primes: n = ∏ p_i^{a_i}
03Read the resultCheck the output against the assumptions before using it.
menu_book

What this calculator does

Input positive integers A and B. The engine executes successive Euclidean remainder divisions to find GCD, computes LCM, and generates prime factorizations.

functions

Formula & method

GCD(A, B) via A = qB + r; LCM(A, B) = |A × B| / GCD(A, B); Canonical primes: n = ∏ p_i^{a_i}

fact_check

Assumptions & notes

  • The Fundamental Theorem of Arithmetic guarantees unique prime factorization for every integer > 1.
  • If GCD(A, B) = 1, the integers are coprime.
  • The Euclidean algorithm computes the greatest common divisor in logarithmic time.