Skip to main content
Retro cartoon-style pyramid characters marching in a line on a light background

Right Triangle Calculator

Find hypotenuse, angles, area, and altitude - with steps

What is a right triangle?

A right triangle has one 90° angle. The side opposite that angle is the hypotenuse (always the longest side). The other two sides are called legs. On this page we label the legs a and b, the hypotenuse c, and the acute angles α and β (they add to 90°). The Pythagorean theorem a² + b² = c² ties the three sides together.

Right triangle with legs a and b and hypotenuse cRight angle at bottom left; horizontal leg length a, vertical leg length b; hypotenuse c joins the acute vertices.abchαβ

Key identities (reference)

These relations match the labels in the calculator (legs a and b, hypotenuse c, acute angles α and β). Use them together with the mode you chose above.
c² = a² + b² ; sin(α) = a/c ; cos(α) = b/c ; tan(α) = a/b ; A = ½ab ; h = ab/c

Solving scenarios for all eight input modes

Every right triangle can be fully solved from any valid pair of values. Worked examples below match each combination the calculator supports. Green pills are the inputs; blue values are computed results.
01

Two legs known

Given

a = 3b = 4

Solved

c
5.000
α
36.870°
β
53.130°
h
2.400
area
6.000
perim
12.000
c = √(3² + 4²) = √25 = 5
α = arctan(3 ÷ 4) = 36.870°
β = 90° − 36.870° = 53.130°

✦ Pythagorean triple (3, 4, 5)

02

Leg + hypotenuse

Given

a = 5c = 13

Solved

b
12.000
α
22.620°
β
67.380°
h
4.615
area
30.000
perim
30.000
b = √(c² − a²) = √(169 − 25) = √144 = 12
α = arcsin(5 ÷ 13) = 22.620°

✦ Pythagorean triple (5, 12, 13)

03

Leg + opposite angle

Given

a = 6α = 30°

Solved

b
10.392
c
12.000
β
60.000°
h
5.196
area
31.177
perim
28.392
c = a ÷ sin(α) = 6 ÷ sin(30°) = 12
b = a ÷ tan(α) = 6 ÷ tan(30°) = 6√3

✦ 30-60-90 special triangle

04

Leg + adjacent angle

Given

a = 7β = 45°

Solved

b
7.000
c
9.899
α
45.000°
h
4.950
area
24.500
perim
23.899
c = a ÷ cos(β) = 7 ÷ cos(45°) = 7√2
b = a × tan(β) = 7 × 1 = 7

✦ 45-45-90 special triangle

05

Hypotenuse + angle

Given

c = 10α = 45°

Solved

a
7.071
b
7.071
β
45.000°
h
5.000
area
25.000
perim
24.142
a = c × sin(α) = 10 × sin(45°) = 5√2
b = c × cos(α) = 10 × cos(45°) = 5√2

✦ a = b → isosceles right triangle

06

Area + leg

Given

A = 24a = 6

Solved

b
8.000
c
10.000
α
36.870°
β
53.130°
h
4.800
perim
24.000
b = 2A ÷ a = 48 ÷ 6 = 8
c = √(6² + 8²) = √100 = 10

✦ Pythagorean triple (6, 8, 10)

07

Perimeter + leg

Given

P = 40a = 8

Solved

b
15.000
c
17.000
α
28.072°
β
61.928°
h
7.059
area
60.000
let s = P − a = 32 (so b + c = 32)
b = (s² − a²) ÷ (2s) = 960 ÷ 64 = 15
c = s − b = 32 − 15 = 17

✦ Pythagorean triple (8, 15, 17)

08

Altitude + hypotenuse

Given

h = 4c = 10

Solved

a
8.944
b
4.472
α
63.435°
β
26.565°
area
20.000
perim
23.416
a+b = √(c(c+2h)) = √180 ≈ 13.416
a−b = √(c(c−2h)) = √20 ≈ 4.472
a = (13.416 + 4.472) ÷ 2 = 8.944

Right triangles in the real world

Every time you climb a ladder, install a ramp, or buy a TV, a right triangle is doing the maths. These five scenarios show how to apply the Pythagorean theorem and trigonometry to everyday problems.

Wheelchair ramp - ADA compliance

Construction & accessibility engineering

Leg + leg → hypotenuse

The problem

A doorway sits 1 foot above street level. ADA regulations require a ramp with no more than a 1:12 slope ratio (1 inch of rise per 12 inches of run). What is the minimum ramp length, and does the slope angle comply?

Known values

rise a = 1 ftrun b = 12 ft

Results

Ramp length c12.042ft
Slope angle α4.764°
ADA max angle4.764° ✓ (exactly at limit)

Step-by-step

1

Find ramp length using Pythagorean theorem

c = √(a² + b²)
c = √(1² + 12²) = √145 ≈ 12.042 ft
2

Find slope angle α using arctan

α = arctan(a ÷ b)
α = arctan(1 ÷ 12) ≈ 4.764°
3

Check ADA compliance (max 1:12 slope)

ADA max = arctan(1/12) = 4.764° ✓

Real-world note: For a 2 ft rise you'd need a 24 ft ramp - the 1:12 ratio scales linearly. Most building codes also require a level 5 ft landing at the top and bottom.

Try this in the calculator

Roof pitch - calculating rafter length

Carpentry & construction

Leg + leg → hypotenuse

The problem

A gable roof has a 5/12 pitch (5 inches of rise for every 12 inches of horizontal run). The building is 24 ft wide, so the horizontal run from wall to ridge is 12 ft. How long does each rafter need to be?

Known values

rise a = 5 ftrun b = 12 ft

Results

Rafter length c13.000ft
Roof angle α22.620°
Area (half-roof)30.000ft²

Step-by-step

1

Identify the right triangle (rise, run, rafter)

a (rise) = 5 ft, b (run) = 12 ft
2

Find rafter length (hypotenuse)

c = √(5² + 12²) = √(25 + 144)
c = √169 = 13 ft exactly
3

Find the roof angle

α = arctan(5 ÷ 12) ≈ 22.620°

Builder's tip: The 5-12-13 triangle is a Pythagorean triple - rafter length works out to a clean integer. Add 12–18 inches to account for the roof overhang (eave). For a 24 ft wide building you'll need two 13 ft rafters per truss pair.

Try this in the calculator

TV screen size - what does "55 inch" mean?

Consumer electronics & display technology

Leg + leg → hypotenuse

The problem

TV screen sizes are measured diagonally, not by width or height. A widescreen 16:9 TV is 48 inches wide and 27 inches tall. What is its advertised screen size, and what angle does the diagonal make?

Known values

width a = 48 inheight b = 27 in

Results

Diagonal c55.045in ("55-inch TV")
Diagonal angle29.357°
Screen area1,296in²

Step-by-step

1

Width and height form two legs

a = 48 in, b = 27 in
2

Diagonal = hypotenuse

c = √(48² + 27²) = √(2304 + 729)
c = √3033 ≈ 55.045 in
3

Find the diagonal angle

α = arctan(27 ÷ 48) ≈ 29.357°

Interesting aside: A 16:9 screen always has its diagonal at ≈29.36° because the ratio is fixed. You can work backwards too: given a "65-inch TV" in 16:9, width = 65 × 16/√337 ≈ 56.6 in and height ≈ 31.8 in.

Try this in the calculator

Ladder safety - the 4-to-1 rule

Safety & construction

Leg + angle → other leg & hyp

The problem

OSHA's "4-to-1 rule" states a ladder should make a 75° angle with the ground (1 ft out for every 4 ft up). You need to reach a gutter 10 ft above the ground. How far from the wall should the ladder base sit, and how long a ladder do you need?

Known values

height a = 10 ftangle α = 75°

Results

Base distance b2.679ft from wall
Ladder length c10.353ft (buy 12 ft)
Angle β15.000° at top

Step-by-step

1

Find base distance using tan

b = a ÷ tan(α)
b = 10 ÷ tan(75°) ≈ 2.679 ft
2

Find ladder length (hypotenuse)

c = a ÷ sin(α)
c = 10 ÷ sin(75°) ≈ 10.353 ft
3

Verify: ladder should extend 3 ft past contact point

Buy at least a 12 ft ladder (10.35 + ~1.65 safety)

Safety rule of thumb: Place the base 1 ft out for every 4 ft of working height. At 75° the tangent is ≈3.73, confirming the 4:1 ratio. An angle steeper than 75° risks the ladder tipping backwards; shallower than 75° risks the base sliding out.

Try this in the calculator

Navigation - shortest route & bearing

Maritime, aviation & hiking

Leg + leg → hypotenuse + angle

The problem

A sailboat travels 30 miles due east, then 40 miles due north to reach port. What is the straight-line distance from start to port, and on what compass bearing should the captain have sailed directly?

Known values

east a = 30 minorth b = 40 mi

Results

Direct distance c50.000miles
Bearing α36.870° E of N (N36.87°E)
Miles saved20.000mi (70 → 50)

Step-by-step

1

East and north legs form a right angle

a = 30 mi (east), b = 40 mi (north)
2

Find direct distance (hypotenuse)

c = √(30² + 40²) = √(900 + 1600)
c = √2500 = 50 miles exactly
3

Find the compass bearing (angle from north)

α = arctan(east ÷ north)
α = arctan(30 ÷ 40) ≈ 36.87° → N36.87°E

Pythagorean triple bonus: 30-40-50 is a 3-4-5 triple scaled by 10. The direct route saves 20 miles - a 28.6% reduction. This is the same triangle Egyptian builders used to lay out right angles, scaled up to ocean distances.

Try this in the calculator

Special right triangles

These two triangles have fixed angle sets that produce side ratios you can memorize. Knowing one side instantly gives you the other two without a calculator. Click a ratio badge in the diagrams to load matching values in Two legs mode, then press Calculate.

30-60-90 triangle

ratio 1 : √3 : 2
30-60-90 reference triangle; ratio boxes load calculator presets90°60°30°a = 1short legb = √3 ≈ 1.732long legc = 2hypotenuseratio a : b : c = 1 : √3 : 2 ≈ 1 : 1.732 : 2
1 : √3 : 2
Angles30°, 60°, 90°
Originbisected equilateral
sin 30°= ½ = 0.5
cos 30°= √3/2 ≈ 0.866

45-45-90 triangle

ratio 1 : 1 : √2
45-45-90 reference triangle; ratio boxes load calculator presets90°45°45°a = 1first legb = 1second legc = √2 ≈ 1.414hypotenuseratio a : b : c = 1 : 1 : √2 ≈ 1 : 1 : 1.414
1 : 1 : √2
Angles45°, 45°, 90°
Typeisosceles right triangle
sin 45°= √2/2 ≈ 0.707
Originhalved square diagonal

How to use the 30-60-90 ratio

Once you know any single side, multiply or divide by the ratio constants to find the rest. The short leg (opposite 30°) is always the base unit.

Know a: b = a√3, c = 2aKnow b: a = b/√3, c = 2b/√3Know c: a = c/2, b = c√3/2
This triangle appears when you bisect an equilateral triangle down its line of symmetry. It underlies the exact values for sin/cos of 30° and 60°.

How to use the 45-45-90 ratio

Because both legs are equal, you only need one value to resolve the whole triangle. The hypotenuse is always √2 times the leg.

Know a (or b): c = a√2Know c: a = b = c/√2 = c√2/2
This triangle appears when a square is cut along its diagonal. The diagonal equals the side length multiplied by √2 - a useful fact for construction, screen aspect ratios, and woodworking.

Pythagorean triples reference table

A Pythagorean triple is any set of three positive integers (a, b, c) that satisfy a² + b² = c². A primitive triple has no common factor - it cannot be reduced further. All other triples are multiples of a primitive one.

The 10 triples below are the first 10 primitive Pythagorean triples ordered by hypotenuse. Every triple in the table has GCD(a, b, c) = 1.

Non-primitive triples (like 6-8-10 or 9-12-15) are simply integer multiples of these - multiply any row by any positive integer and you get another valid right triangle with integer sides.

The proportional bars show the relative lengths of each side within the triple, making it easy to see how the shapes become more elongated as the hypotenuse grows.

How to verify any triple

a² + b² = c²
e.g. 3-4-5:
9 + 16 = 25 ✓
e.g. 5-12-13:
25 + 144 = 169 ✓
#Triple (a, b, c)Side proportionsVerificationNotes
01Most famous
3, 4, 5
a
3
b
4
c
5
9 + 16 = 25 ✓Used by Egyptian builders; angles ≈ 36.87° and 53.13°
025, 12, 13
a
5
b
12
c
13
25 + 144 = 169 ✓Roof pitch example above; angles ≈ 22.62° and 67.38°
038, 15, 17
a
8
b
15
c
17
64 + 225 = 289 ✓Perimeter example (P=40); angles ≈ 28.07° and 61.93°
047, 24, 25
a
7
b
24
c
25
49 + 576 = 625 ✓Very flat triangle; angles ≈ 16.26° and 73.74°
0520, 21, 29
a
20
b
21
c
29
400 + 441 = 841 ✓Nearly isosceles legs (20 ≈ 21); angles ≈ 43.60° and 46.40°
069, 40, 41
a
9
b
40
c
41
81 + 1600 = 1681 ✓b and c differ by 1 - a pattern: (n, (n²−1)/2, (n²+1)/2)
0712, 35, 37
a
12
b
35
c
37
144 + 1225 = 1369 ✓Elongated; angles ≈ 18.92° and 71.08°
0811, 60, 61
a
11
b
60
c
61
121 + 3600 = 3721 ✓Another b+1=c triple; angles ≈ 10.39° and 79.61°
0913, 84, 85
a
13
b
84
c
85
169 + 7056 = 7225 ✓Extremely flat; angle α ≈ 8.77°
1028, 45, 53
a
28
b
45
c
53
784 + 2025 = 2809 ✓More balanced shape; angles ≈ 31.89° and 58.11°

Generate any primitive triple with Euclid's formula

Every primitive Pythagorean triple can be generated by choosing two positive integers m > n where m and n are coprime and not both odd. The formula is:

a = m² − n²b = 2mnc = m² + n²

Example: m=2, n=1 → a=3, b=4, c=5. Try m=3, n=2 → a=5, b=12, c=13. Try m=4, n=1 → a=15, b=8, c=17. Since there are infinitely many valid (m, n) pairs, there are infinitely many Pythagorean triples.

FAQ

How do I find the hypotenuse of a right triangle?

Use the Pythagorean theorem: c = √(a² + b²), where a and b are the two legs and c is the hypotenuse. For example, if a = 3 and b = 4, then c = √(9 + 16) = 5.

What is the Pythagorean theorem?

In a right triangle, the square of the hypotenuse equals the sum of the squares of the legs: a² + b² = c². It only applies when one angle is exactly 90°.

Can I use this if I only know one side and one angle?

Yes. Pick the mode that matches what you know - for example “Leg + opposite angle” if you have a leg and the acute angle opposite it - then enter the values. The calculator uses sine, cosine, or tangent as needed.

What is a 30-60-90 triangle?

A right triangle with acute angles 30° and 60°. Its sides are in the ratio 1 : √3 : 2 (short leg : long leg : hypotenuse). It appears often in geometry and construction.

What is a 45-45-90 triangle?

An isosceles right triangle: both acute angles are 45°, and the legs are equal. Side ratios are 1 : 1 : √2 (leg : leg : hypotenuse).

How do I calculate the area of a right triangle?

Area equals half the product of the legs: A = ½ × a × b. You can also use A = ½ × hypotenuse × altitude to the hypotenuse.

What is the altitude of a right triangle?

The altitude h from the right-angle vertex to the hypotenuse has length h = (a × b) / c. It splits the triangle into two smaller right triangles similar to the original.

What are Pythagorean triples?

Three whole numbers (a, b, c) that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13. They represent side lengths of a right triangle with integer sides.

How do I convert degrees to radians?

Multiply degrees by π/180. For example, 45° = π/4 radians. In radian mode you can also type expressions like pi/4 or pi/3.

Why does a² + b² = c² only work for right triangles?

That exact relationship is equivalent to the angle opposite c being 90°. For other triangles you need the law of cosines: c² = a² + b² − 2ab cos(C).

Tips & Strategies

The hypotenuse must be the longest side. The right angle sits between the two legs; the hypotenuse is opposite the 90° corner. If a leg you typed is larger than the side you labeled as the hypotenuse, fix the labels or your chosen mode before trusting the rest of the solution.

Match your angle unit to how you are thinking. Degrees and radians both work, but switching mental math (for example picturing 45°) while the tool is in radians quietly breaks checks. Align the calculator’s angle mode with your inputs, and use expressions like pi/4 when you mean 45° in radians.

Let α + β = 90° double-check your work. The two acute angles must sum to exactly a right angle (90° or π/2 rad). After a solve, verify that relationship and that each angle still fits the sides you entered.

Area uses both legs, not the hypotenuse. For a right triangle, area is one-half the product of the legs. If you start from hypotenuse plus one leg, solve for the missing leg first, then plug into ½ab.

Redraw when numbers feel impossible. Sketch the triangle with the same labels as the diagram, mark which angle is opposite each side, and compare simple ratios such as leg over hypotenuse to sine or cosine. A quick picture catches swapped legs or wrong mode faster than debating decimals.

Things Worth Knowing

  • The 3-4-5 triangle is ancient. Egyptian rope-stretchers (harpedonaptai) used knotted ropes with 12 equal segments to lay out perfect right angles for the pyramids around 2000 BC - long before Pythagoras was born. The theorem bears his name, but the knowledge is thousands of years older.
  • Pythagoras was not first, and might not have proved it. The Babylonians documented Pythagorean triples on the clay tablet Plimpton 322 around 1800 BC - over 1,200 years before Pythagoras. Indian mathematician Baudhayana also stated the theorem in the Sulba Sutras around 800 BC.
  • There are infinitely many Pythagorean triples. You can generate them all with two integers m > n using the formula: a = m² - n², b = 2mn, c = m² + n². Plug in any two integers and you get a valid triple.
  • The 345,345,345-triangle does not exist. A right triangle can never be equilateral - if all three sides were equal, no angle could be 90°. The closest an equilateral triangle gets to "right" is its 60° angles, which are as far from 90° as you can get while still being acute.
  • A right triangle fits perfectly inside a semicircle. If you draw a triangle where the hypotenuse is the diameter of a circle, the right-angle vertex will always land exactly on the circle's edge - no matter where you put it. This is Thales' theorem, from around 600 BC, and it is one of the oldest recorded geometric proofs.
  • The spiral of Theodorus: if you chain right triangles together - each new one using the previous hypotenuse as one leg and a leg of length 1 - you get a spiral that approximates the golden spiral. It was drawn by the Greek mathematician Theodorus of Cyrene around 400 BC and contains the square roots of every integer from 2 to 17.
  • Right triangles power GPS. The trilateration calculation that locates your phone uses the 3D Pythagorean relationship (a² + b² + c² = d²) to find the distance from each satellite. Your position is the intersection of three spheres - each radius calculated from a right-triangle relationship.
  • The world's most expensive right triangle: the Pythagorean theorem is the most proven theorem in mathematics, with over 370 distinct proofs on record - including one by US President James Garfield, who published his own original proof in 1876 while serving as a congressman.