Polynomial GCD Calculator
Enter the coefficients of two polynomials to find their greatest common divisor.
Result
How it is calculated
Each polynomial is typed as a comma-separated list of coefficients from the highest power down to the constant, so 1,0,-1 means x2 − 1. A missing power must be entered as 0. The tool runs the Euclidean algorithm: divide A by B, keep the remainder R, replace (A, B) by (B, R), and repeat until the remainder is zero. The last non-zero polynomial is the GCD. Because any constant multiple of a common divisor is also a common divisor, the result is scaled so its leading coefficient is 1 (monic). Coefficients are read as decimals, results are rounded to six places, and the loop stops after 100 steps. The output shows the polynomial and its degree; a GCD of degree 0 (just 1) means the two polynomials share no common factor.
Worked example
Take A = x2 − 1 (1,0,-1) and B = x2 − 3x + 2 (1,-3,2). Dividing A by B gives quotient 1 and remainder A − B = 3x − 3. Next, dividing B by 3x − 3 leaves remainder 0, so 3x − 3 is the last non-zero remainder. Scaling by its leading coefficient 3 gives the monic GCD x - 1, of degree 1. This matches the factorisations (x − 1)(x + 1) and (x − 1)(x − 2).
Common mistakes
- Listing coefficients in ascending order. The first number must belong to the highest power; entering
-1,0,1describes −x2 + 1, not x2 − 1. - Skipping zero coefficients. For x3 − 1 you must type
1,0,0,-1; typing1,-1is just x − 1. - Typing terms such as
x^2-1instead of numbers. Only plain numeric coefficients separated by commas are accepted, and anything else returns no result. - Expecting the GCD to keep your scale. It is always normalised to leading coefficient 1, so a common factor of 3 or 2 does not appear in the answer.
- Reading "1" as an error. A GCD of 1 (degree 0) is a valid answer meaning the polynomials are coprime.
About this calculator
Just as integers have a greatest common divisor, two polynomials have a polynomial GCD — the highest-degree polynomial that divides both of them with no remainder. It's computed with the same Euclidean algorithm used for integers: repeatedly take the remainder of dividing the higher-degree polynomial by the lower-degree one until the remainder is zero, then normalize the result to monic form (leading coefficient 1) for a unique answer.
Polynomial GCD is a building block in computer algebra systems (Mathematica, Maple, SymPy) for simplifying rational expressions and factoring, and it underlies decoding algorithms for Reed-Solomon error-correcting codes used in QR codes, CDs, and satellite communication.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The answer is always scaled so the leading coefficient is 1, so 2,-4,2 and 1,-1 both give x - 1, not 2x - 2. A result of 1 with degree 0 means the polynomials share no factor, which is the case for 1,0,-1 and 1,0,1. Use this to simplify a rational expression: divide top and bottom by the result. Which fraction are you trying to reduce?