최대공약수·최소공배수 계산기

GCD & LCM Calculator

최대공약수·최소공배수 계산기란?

최대공약수(GCD)는 두 개 이상의 정수를 동시에 나누어 떨어지게 하는 가장 큰 수이고, 최소공배수(LCM)는 그 정수들의 공통 배수 중 가장 작은 수입니다. 이 계산기는 콤마로 구분한 정수 여러 개를 받아 GCD와 LCM을 즉시 계산합니다.

사용 방법

계산할 양의 정수를 콤마(,)로 구분해 2개 이상 입력한 뒤 계산하기를 누릅니다. 예: 12, 18, 24. 소수·음수·0은 입력할 수 없습니다.

공식·계산 과정

유클리드 호제법: GCD(a, b) = GCD(b, a mod b), b가 0이 될 때까지 반복. LCM(a, b) = (a × b) ÷ GCD(a, b). 숫자가 3개 이상이면 두 개씩 순서대로 누적 계산합니다.

예시
입력GCDLCM
12, 18636
12, 18, 24672
What is the GCD & LCM Calculator?

The greatest common divisor (GCD) is the largest number that evenly divides two or more integers, while the least common multiple (LCM) is the smallest number that is a multiple of all of them. This tool accepts comma-separated integers and computes both instantly.

How to use it

Enter two or more positive integers separated by commas, e.g. 12, 18, 24, then press Calculate. Decimals, negatives, and zero are not accepted.

Formula & process

Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until b is 0. LCM(a, b) = (a × b) ÷ GCD(a, b). For three or more numbers, the result accumulates pairwise in order.

Examples
InputGCDLCM
12, 18636
12, 18, 24672
최대공약수(GCD)는 어떻게 계산되나요?
이 계산기는 유클리드 호제법을 사용합니다. 두 수 a, b가 있을 때 a를 b로 나눈 나머지를 구해 b와 나머지의 쌍으로 반복하며, 나머지가 0이 되었을 때의 b가 최대공약수입니다. 숫자가 3개 이상이면 앞에서부터 두 개씩 GCD를 구해 누적합니다.
최소공배수(LCM)는 어떻게 계산되나요?
두 수 a, b의 최소공배수는 (a×b) ÷ GCD(a,b) 공식으로 계산합니다. 숫자가 여러 개인 경우 앞의 두 값의 LCM을 구한 뒤, 그 결과와 다음 값의 LCM을 순서대로 누적해 계산합니다.
음수나 0을 입력해도 되나요?
이 계산기는 1 이상의 양의 정수만 지원합니다. 0이나 음수, 소수를 입력하면 오류로 표시되며, 콤마로 구분해 2개 이상의 정수를 입력해야 계산이 가능합니다.
How is the GCD calculated?
This tool uses the Euclidean algorithm: for two numbers a and b, it repeatedly replaces (a, b) with (b, a mod b) until the remainder is 0 — the last nonzero b is the GCD. For three or more numbers, GCD is accumulated pairwise from left to right.
How is the LCM calculated?
The LCM of two numbers a and b is (a×b) ÷ GCD(a,b). For multiple numbers, the LCM of the first two is computed, then combined with each subsequent value in order.
Can I enter negative numbers or zero?
This tool only supports positive integers of 1 or greater. Zero, negative numbers, or decimals will show an error, and you must enter two or more comma-separated integers.

안내: 본 계산기는 일반적인 수학 계산 결과를 제공합니다. 매우 큰 수를 입력하면 자바스크립트의 안전 정수 범위를 벗어나 오차가 발생할 수 있으므로, 정밀한 검증이 필요한 계산에는 별도 확인을 권장합니다.

Note: This calculator provides standard mathematical results. Extremely large numbers may exceed JavaScript's safe integer range and introduce errors — please double-check figures where precise verification is required.