Pythagorean Triple Generator
Enter integers m and n (m > n ≥ 1) to generate a Pythagorean triple.
Result
How it is calculated
The tool applies Euclid's formula to two whole numbers m and n with m > n ≥ 1:
a = m² − n², b = 2mn, c = m² + n²
These always satisfy a² + b² = c², so they are the two legs and the hypotenuse of a right triangle with whole-number sides. Decimals are rejected, and so is any pair where m is not larger than n or n is below 1. The tool does not check that the triple is primitive. If m and n share a factor, or are both odd, the three numbers will have a common divisor (for m = 5 and n = 3 you get 16, 30, 34, which is 2 times 8, 15, 17).
Worked example
Choose m = 5 and n = 2. Then a = 25 − 4 = 21, b = 2 × 5 × 2 = 20 and c = 25 + 4 = 29. Check: 21² + 20² = 441 + 400 = 841, and 29² = 841. So a triangle with sides 20, 21 and 29 has a right angle. Because 5 and 2 are coprime and of opposite parity, this triple is primitive.
Common mistakes
- Entering m smaller than or equal to n; the order matters, m must be the larger number.
- Typing decimals like 2.5, which are rejected. Both inputs must be whole numbers.
- Assuming every result is a primitive triple. Pairs such as 5 and 3 give 16, 30, 34, which reduces to 8, 15, 17.
- Expecting every triple to appear from a single pair. Euclid's formula gives primitive ones; non-primitive ones come from multiplying all three numbers by k, for example 6, 8, 10 from 3, 4, 5.
- Mixing up which number is the hypotenuse: c is always the largest, and a and b are the legs, though a may be larger or smaller than b.
About this calculator
This calculator generates Pythagorean triples using Euclid's formula: for any two positive integers m > n, the triple a = m² − n², b = 2mn, c = m² + n² always satisfies a² + b² = c². Choosing m and n coprime and not both odd yields every primitive Pythagorean triple (other choices, such as m = 3, n = 1 giving 8-6-10, give a multiple of a primitive triple), and scaling the result by any integer k produces all non-primitive ones too.
Pythagorean triples describe right triangles with whole-number side lengths — like the well-known 3-4-5 triangle — and are used in geometry education, construction layout (squaring corners without a protractor), and number theory.
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)
A practical use is squaring a corner on site. The pair m = 2, n = 1 gives the 3-4-5 triple, and m = 3, n = 2 gives 5-12-13. Multiply every side by the same number to work at full scale: 3-4-5 becomes 9-12-15 or 30-40-50, and the corner is square when your three measurements match. Remember the tool gives only one triple per pair. Which pair of numbers produced a triple you liked, and what are you laying out?