Measurements & Conversions

Triangle Calculator — Right Triangle and Any Triangle Solver

Solve a right triangle from any two of rise, run, slope length and angle, or any triangle from three known parts: every side, every angle and the area.

  • Answers as you type
  • Every formula cited
  • Calculated in your browser
SettingsSettings for this calculationUS
Market
Imperial · sales tax
Pick the pair of values you have for a right triangle, or the three you have for any other.

A right triangle — a rafter, a stringer, a brace, a ladder against a wall — is fixed by any two of its rise, run, slope length and slope angle, and only the fields for the pair chosen are shown. Any other triangle needs three values including at least one side: three sides, two sides with the angle between them, two angles with the side between them, or two angles with a side opposite one. Two sides with an angle that is not between them is the one case that can fit two triangles, and the page then shows both.

The vertical leg: how far the slope climbs over its run.

For a common rafter it is the height the rafter's line climbs from the wall plate to the ridge's centre line; for a stair, the finished floor-to-floor height of the flight; for a brace, the height of the frame between the points it joins. Measure it plumb, not along anything that leans.

Tools needed: Tape measure, Spirit level or laser

The horizontal leg: the plan distance the slope covers.

For a common rafter it is half the span, measured level from the outside of the wall plate to the ridge's centre line, with the rise taken over that same run; half the ridge's thickness comes off the rafter afterwards, measured square to the ridge. For a stair it is the total going from the first nosing to the last; for a brace, the width of the frame between the brace's ends. A run measured along a sloping floor is not a run.

Missing side or area

12.65 ft slope length

High confidence

Rise and run fix the triangle: the slope length is the square root of the two squared and added, and the slope angle is the one whose tangent is rise over run. A common rafter's run and rise give its line length this way, a flight's total rise and total going give the stringer, and a frame's height and width give the brace across it.

Rise, side a
4 ft
Run, side b
12 ft
Slope length, side c
12.65 ft
Slope angle at the base, angle A
18.43 °
Angle at the top, angle B
71.57 °
Rise over run
33.33 %
Area
24 ft²
Perimeter
28.65 ft
Then change the inputs to see how far the answer moves.

Show calculation logic

How this was calculated

Formula source(s)

  • NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles: the right-triangle ratios sin A = a/c, cos A = b/c and tan A = a/b (4.42.1–4.42.3), the law of sines (4.42.4), the law of cosines c² = a² + b² − 2ab cos C (4.42.5), and the area ½bc sin A = √(s(s − a)(s − b)(s − c)) with s the semi-perimeter (4.42.7)
  • Euclid, Elements, Book I (D. E. Joyce's edition, Clark University): Proposition 47, the square on the side opposite the right angle equals the squares on the other two sides together; Proposition 32, the three angles of a triangle together make two right angles; Proposition 20, any two sides of a triangle together are greater than the third
  • OpenStax, Algebra and Trigonometry 2e (Rice University), §10.1 Non-right Triangles: Law of Sines — two sides and a non-included angle (SSA) may give no triangle, one right triangle, one triangle or two triangles; the area of an oblique triangle is half the product of two sides and the sine of the angle between them
  • DeWALT Rafter Square (DWHT46031) instruction manual: rafter lengths from the tables are to the centre of the ridge, so half the ridge board's thickness is deducted from the listed length before the top plumb cut is made, measured at right angles to the top plumb cut line and marked parallel to it; the worked example takes the run as half of a 20 ft building's width

Inputs used

What You Know
Right triangle: the rise and the run
Rise
4 ft
Run
12 ft
Run
12 ft
Slope Length
13 ft
Rise
8.5 ft
Slope Length
14 ft
Run
12 ft
Slope Angle (degrees)
30
Rise
8.5 ft
Slope Angle (degrees)
35
Slope Length
15.5 ft
Slope Angle (degrees)
45
Side a
23 ft
Side b
16.5 ft
Side c
19.5 ft
Side b
13 ft
Side c
16.5 ft
Angle A Between Them (degrees)
60
Angle B (degrees)
50
Angle C (degrees)
60
Side a Between Them
19.5 ft
Angle A (degrees)
40
Angle B (degrees)
60
Side a
16.5 ft
Side a
13 ft
Side b
16.5 ft
Angle A (degrees)
40

Intermediate steps

Rise, side a
4 ft
Run, side b
12 ft
Slope length, side c
12.65 ft
Slope angle at the base, angle A
18.43 °
Angle at the top, angle B
71.57 °
Rise over run
33.33 %
Area
24 ft²
Perimeter
28.65 ft
Final result12.65 ft slope length

Confidence note: Rise and run fix the triangle: the slope length is the square root of the two squared and added, and the slope angle is the one whose tangent is rise over run. A common rafter's run and rise give its line length this way, a flight's total rise and total going give the stringer, and a frame's height and width give the brace across it.

What this calculation does not cover

  • This is plane geometry: every side is a straight line on a flat surface. A tape laid down a slope measures the slope and not the plan distance, so a triangle meant for a plan, a plot or a slab needs horizontal measurements — stepped down the slope or taken along a level line — or the figures describe a different triangle from the one being set out.
  • A right triangle takes exactly two values. Knowing a third does not make the answer better, it makes a check: solve from the two you trust most and compare the third with what the page returns, because a disagreement is a measuring error somewhere.
  • Angles are typed in decimal degrees. A reading in degrees and minutes has to be converted first — thirty degrees and fifteen minutes is 30.25 — and a roof pitch given as a rise per unit of run belongs on the rise and run fields, not in an angle box.
  • The lengths are line lengths between points, not cut lengths. A rafter's line runs from the ridge's centre line to the outside of the wall plate; the ridge deduction — half the ridge's thickness, measured square to the ridge — the overhang and the seat cut all come afterwards and are worked on the rafter pages, and a stringer's cutting length depends on how its ends are detailed.
  • Small angular errors grow with distance. One degree off over 10 m (33 ft) moves the far end about 175 mm (7 in), so an angle that sets out a long line wants measuring as carefully as the lengths, and a long triangle is better fixed by its three sides than by an angle.
  • Values that cannot make a triangle are not repaired. The page returns zero with the reason and the amount by which the figures miss, rather than guessing which of them was meant.
12 ft4 ft
Schematic, drawn to the proportions you entered — not to scale on screen.

Computed in your browser — nothing you enter is uploaded. Presented in US customary units and US trade terminology. Where a formula follows a published standard, that standard and its edition are cited beside it on this page; where none governs, the page says so. Local amendments override model codes — verify against the code in force where you build.

Sources checked 2026-10-05 · v1.0.0

Regulatory standards & verification citations4
  1. NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles: the right-triangle ratios sin A = a/c, cos A = b/c and tan A = a/b (4.42.1–4.42.3), the law of sines (4.42.4), the law of cosines c² = a² + b² − 2ab cos C (4.42.5), and the area ½bc sin A = √(s(s − a)(s − b)(s − c)) with s the semi-perimeter (4.42.7)
  2. Euclid, Elements, Book I (D. E. Joyce's edition, Clark University): Proposition 47, the square on the side opposite the right angle equals the squares on the other two sides together; Proposition 32, the three angles of a triangle together make two right angles; Proposition 20, any two sides of a triangle together are greater than the third
  3. OpenStax, Algebra and Trigonometry 2e (Rice University), §10.1 Non-right Triangles: Law of Sines — two sides and a non-included angle (SSA) may give no triangle, one right triangle, one triangle or two triangles; the area of an oblique triangle is half the product of two sides and the sine of the angle between them
  4. DeWALT Rafter Square (DWHT46031) instruction manual: rafter lengths from the tables are to the centre of the ridge, so half the ridge board's thickness is deducted from the listed length before the top plumb cut is made, measured at right angles to the top plumb cut line and marked parallel to it; the worked example takes the run as half of a 20 ft building's width
Cite this page

Your workspace

Most jobs need more than one number. Add the calculators you need next and they open right here, underneath this one — your figures stay on screen and nothing is lost to a page change.

Now that you have the number

These guides cover the work this quantity is for — the first ones run this calculator inside the section that raises the question.

  • Cutting and Setting Raftersuses this calculator

    A carpenter's field guide to rafter layout, treating every plumb, seat and cheek cut as one triangle solved from run and rise.

How to calculate triangle — right triangle and any triangle solver in 29 steps

  1. What You KnowPick the pair of values you have for a right triangle, or the three you have for any other.
  2. RiseThe vertical leg: how far the slope climbs over its run.
  3. RunThe horizontal leg: the plan distance the slope covers.
  4. RunThe horizontal leg, measured level.
  5. Slope LengthThe hypotenuse: the length along the slope between the same two points.
  6. RiseThe vertical leg: the height the slope has to climb.
  7. Slope LengthThe length along the slope, which sets how far out its base lands.
  8. RunThe horizontal leg under the slope.
  9. Slope Angle (degrees)The angle between the run and the slope, at the base of the slope, in degrees.
  10. RiseThe vertical leg the slope has to climb.
  11. Slope Angle (degrees)The angle the slope makes with the level, in degrees.
  12. Slope LengthThe length of the sloping member between its two points.
  13. Slope Angle (degrees)The angle between the member and the level, in degrees.
  14. Side aOne side; angle A is the corner opposite it.
  15. Side bThe second side; angle B faces it.
  16. Side cThe third side; angle C faces it.
  17. Side bOne of the two sides that meet at the known angle.
  18. Side cThe other side meeting at the known angle.
  19. Angle A Between Them (degrees)The angle at the corner where sides b and c meet, in degrees.
  20. Angle B (degrees)The angle at one end of the known side, in degrees.
  21. Angle C (degrees)The angle at the other end of the known side, in degrees.
  22. Side a Between ThemThe side joining the two known angles.
  23. Angle A (degrees)The angle opposite the known side, in degrees.
  24. Angle B (degrees)A second angle, at one end of the known side, in degrees.
  25. Side aThe known side, the one opposite angle A.
  26. Side aThe side opposite the known angle A.
  27. Side bThe other known side, which meets side c at angle A.
  28. Angle A (degrees)The known angle, opposite side a and not between the two known sides, in degrees.
  29. Missing side or areaThe tool computes the missing side or area from those figures and shows the formula, its sources, and a confidence rating alongside it.

Missing side or area by rise

Page defaults, not your figures above.

RiseMissing side or area (ft slope length)
2 ft12
3 ft12.2
4 ft12.5
5 ft12.8
6 ft13.2
7 ft13.7

Frequently asked questions

Why can two sides and an angle give two different triangles?
Because the angle is at the wrong corner to pin anything down. Picture side b running out from the known angle A along one line, and side a hanging from its far end, free to swing. If side a is shorter than the perpendicular from that end to the other line — the height b × sin A — it never reaches. If it is exactly that height, it meets the line square, once. If it is longer than the height but shorter than side b, it reaches the line at two points, one each side of the foot of the perpendicular, and both make a valid triangle with the same three given values. If it is at least as long as side b, the nearer crossing falls behind the corner and only one triangle is left. The page works out which case you are in and, when there are two, shows both, because guessing would be a coin toss with a cut timber riding on it.
How do I use this for a rafter, a stair stringer or a brace?
Each is the slope of a right triangle. For a common rafter, the run is half the span, from the outside of the wall plate to the ridge's centre line, and the rise is the height the line climbs over that run; the slope length is then the line length to the centre line, and angle A is the pitch. Half the ridge's thickness comes off that length before the top cut is marked, measured square to the ridge — at right angles to the top plumb line — as the rafter-square makers' tables assume; never shorten the run and keep the full rise, which tilts the pitch. For a stringer, enter the total rise and the total going; the slope length is the stringer's line and angle A the pitch of the flight. For a brace across a frame or a gate, the rise and run are the height and width between the brace's ends. Where the job has its own page — the common rafter, the stair or the hip and valley calculators — use that for the cutting detail, and this one for any combination of figures those pages do not take.
Can I measure the area of an awkward plot with it?
Yes, by triangulation, which needs nothing but a tape. Split the plot into triangles from one corner, peg each corner, tape every side of every triangle on the level, and enter each triangle's three sides; the areas add up to the plot's. Keep the triangles as close to equilateral as the shape allows, because a long thin triangle magnifies any taping error in its area. For a plot with many corners or curved edges, the offsets-and-coordinates calculator does the same job in one pass.
Which side is a, which is b and which is c?
Each angle carries the letter of the side opposite it: angle A faces side a, and so on. For a right triangle this page fixes the names so the builder's words fit: a is the rise, b is the run, c is the slope, C is the right angle and A is the angle at the base of the slope. For any other triangle you can name the sides in whatever order is convenient, as long as each angle you enter faces the side with its letter.
Why does the page sometimes say the triangle is flat, or impossible?
Because some sets of numbers do not make a triangle and it would be wrong to pretend otherwise. Three sides close only if the longest is shorter than the other two together; equal, and the three points sit on one straight line with no area, which the page reports as flat. Two angles that add up to 180 degrees or more leave nothing for the third. A run or rise longer than its slope, or an SSA side too short to reach, cannot close either. In each case the answer is zero and a row says by how much the figures miss, which usually points straight at the measurement that was mis-read.
How exact do the angles need to be?
More exact than most people expect over any distance. The far end of a line moves sideways by about its length times the angle error in radians, so a single degree over 10 m (33 ft) is roughly 175 mm (7 in). That is why setting out favours lengths over angles: a triangle fixed by three taped sides is far less sensitive than one fixed by an angle read off a protractor, and the squaring and diagonal pages use lengths for the same reason.
Preliminary estimate, not certified engineering. This tool produces an indicative quantity calculation for planning purposes only — it is not a certified structural analysis, a guaranteed material takeoff, or a substitute for building department approval. Always verify measurements on-site and have a licensed contractor or structural engineer review any load-bearing, code-sensitive, or safety-critical work before purchasing materials or starting construction. Spotted an arithmetic or standards error? Report it to contact@craftquantities.com with your inputs — a confirmed fix gets a permanent check of its own, so the same mistake cannot come back.