What Is a Diagonal: Definition Formula and Examples

#Diagonal
TL;DR
A diagonal is a straight segment joining two corners of a polygon that are not next to each other. A polygon with nn sides has n(n−3)2\dfrac{n(n-3)}{2} diagonals, and Pythagoras gives their lengths.
Vaishali Tomar·reviewed byShikha SharmaLast updated on December 2, 202613 min read

Key Points

  • A diagonal joins two non-adjacent vertices. A side joins neighbouring vertices; a line to the middle of a side is neither.
  • Every vertex sends out n−3n - 3 diagonals, and each diagonal has two ends, so a polygon has n(n−3)2\dfrac{n(n-3)}{2}.
  • A triangle has none, a quadrilateral 2, a pentagon 5, a hexagon 9, an octagon 20.
  • In a convex polygon every diagonal stays inside; in a concave polygon at least one runs outside.
  • Diagonal lengths come from Pythagoras: s2s\sqrt{2} for a square, l2+w2\sqrt{l^2 + w^2} for a rectangle, l2+w2+h2\sqrt{l^2 + w^2 + h^2} through a box.

Why a Wobbly Frame Needs a Diagonal

Nail four sticks into a rectangle, push one corner, and it leans into a parallelogram. Nail one more stick from corner to opposite corner and it locks solid.

  • That extra stick is a diagonal. It splits the frame into two triangles, and a triangle cannot change shape.
  • Gates, shelf backs, bridges and cranes all carry one.
  • Two questions follow: how many diagonals can a shape have, and how long is each?
a diagonal brace stops a four-sided frame from leaning by splitting it into two triangles
Two frames. Left: a rectangular frame with hinged corners leaning over into a parallelogram, with an orange arrow showing the push. Right: the same frame with a green diagonal brace from corner to corner, standing square and rigid.

What Is a Diagonal?

A diagonal is a line segment joining two corners (vertices) of a polygon that are not next to each other. Sides join neighbouring corners; a diagonal reaches across the shape.

  • The word is Greek: dia, "through", and gonia, "angle".
  • It must end at two vertices. A line to the middle of a side is not a diagonal.
  • The vertices must not be neighbours. If they share a side, the segment is that side.
  • In pentagon ABCDE, AC is a diagonal, AB is a side, and a line from E to the middle of CD is neither.
a diagonal joins two corners that are not neighbours, unlike a side or a line to the middle of a side
A regular pentagon ABCDE with its five diagonals dashed. The diagonal AC is highlighted in orange and labelled as a diagonal joining A and C, the side AB is highlighted in green and labelled as a side joining neighbours, and a grey dotted line from E to the midpoint of CD is labelled as not a diagonal because it does not end at a corner.

Euclid called a parallelogram's diagonal its diameter and proved it cuts the shape into two equal halves (Elements, Book I, Proposition 34).

Why Does a Triangle Have No Diagonals?

A triangle has zero diagonals.

  • Every corner is next to both others, so any corner-to-corner line is already a side.
  • Four sides is the first count with a pair of corners not joined by a side.
  • So the quadrilateral is the first polygon with diagonals: exactly 2.

How Many Diagonals Does a Polygon Have? The Formula

A polygon with nn sides has n(n−3)2\dfrac{n(n-3)}{2} diagonals, regular or not. Two arguments agree.

Argument 1: count from each vertex, then halve

  1. One vertex has n−1n - 1 others.
  2. Two are neighbours (sides), leaving n−3n - 3 diagonals.
  3. Over all nn vertices: n(n−3)n(n - 3) ends.
  4. Each diagonal has two ends, so divide by 2.
n(n−3)2\frac{n(n-3)}{2}

Argument 2: all pairs, minus the sides

There are n(n−1)2\dfrac{n(n-1)}{2} pairs of vertices, and nn of them are sides:

n(n−1)2−n=n(n−3)2\frac{n(n-1)}{2} - n = \frac{n(n-3)}{2}

Number of Diagonals for Common Shapes

Feed each nn into n(n−3)2\dfrac{n(n-3)}{2}:

the number of diagonals grows quickly, from 0 in a triangle to 20 in an octagon
Six regular polygons with every diagonal drawn, from a triangle to an octagon, labelled with their diagonal counts 0, 2, 5, 9, 14 and 20 and the working n times n minus 3 over 2.
Polygon Sides nn From one vertex n−3n - 3 Diagonals n(n−3)2\dfrac{n(n-3)}{2}
Triangle 3 0 0
Quadrilateral 4 1 2
Pentagon 5 2 5
Hexagon 6 3 9
Heptagon 7 4 14
Octagon 8 5 20
Decagon 10 7 35
20-gon 20 17 170

Not every number is possible

  • Exactly 10 diagonals needs n2−3n−20=0n^2 - 3n - 20 = 0, which has no whole-number answer.
  • So the possible counts are 0, 2, 5, 9, 14, 20, 27, 35 and so on.

Diagonals of Convex and Concave Polygons

In a convex polygon every diagonal lies inside; in a concave polygon at least one lies outside. The count stays the same.

  • In a convex quadrilateral, the two diagonals cross inside.
  • In an arrowhead, they do not cross: one runs inside, the other jumps across the notch outside. It is still a diagonal.
in a concave quadrilateral one diagonal runs outside the shape and the two diagonals do not cross
Two quadrilaterals. Left: a convex quadrilateral ABCD whose two blue diagonals cross inside it. Right: an arrowhead ABCD with a reflex angle of 246 degrees at B; the diagonal BD runs inside, and the diagonal AC is dashed orange, running outside across the notch.
  • Quick test: if any diagonal leaves the shape, it is concave (see convex polygon).

In the shape lab, tick Show all diagonals, then drag a corner inwards past 180°180° and watch a diagonal turn orange as it leaves.

Try It Yourself

Use the polygon lab to see What Is a Diagonal at work: drag, change the numbers and watch what happens.

Length of a Diagonal

Most diagonal lengths come from Pythagoras, because a diagonal is usually the hypotenuse of a hidden right triangle.

  • Square, side ss: d2=s2+s2d^2 = s^2 + s^2, so d=s2≈1.414sd = s\sqrt{2} \approx 1.414s.
  • Rectangle, ll by ww: d=l2+w2d = \sqrt{l^2 + w^2} (see properties of a rectangle). A 6 by 8 rectangle has diagonal 10.
  • Rhombus: unequal diagonals that cross at right angles and bisect each other: (p2)2+(q2)2=a2\left(\frac{p}{2}\right)^2 + \left(\frac{q}{2}\right)^2 = a^2, where pp and qq are the diagonals and aa is the side. See the diagonal of a rhombus.
the diagonal of a square or rectangle is the hypotenuse of a right triangle
Two panels. Left: a square with side 8 centimetres and its orange diagonal labelled 8 root 2, about 11.31 centimetres, with the right triangle shaded yellow. Right: a rectangle 8 by 6 centimetres with its diagonal labelled root of 64 plus 36 equals 10 centimetres.
  • A rectangle's diagonals are equal. A kite's are usually unequal, and only one is cut in half.

Regular polygons have only a few lengths

  • A diagonal's length depends only on how many corners it skips.
  • A regular pentagon has one length (about 1.6181.618 times the side; see the pentagram).
  • A regular octagon with side 1 has three: about 1.8481.848, 2.4142.414 and 2.6132.613.
a regular octagon has only three different diagonal lengths among its twenty diagonals
A regular octagon ABCDEFGH with side 1 and all twenty diagonals dashed in three colours. From A, the diagonal skipping one corner is blue, 1.848 long; skipping two is green, 2.414; skipping three is orange, 2.613.

A Piece of History: the Diagonal That Doubled a Square

The square's diagonal, s2s\sqrt{2}, has a famous story. In Plato's Meno (around 385 BCE), Socrates asks a boy to draw a square twice the area of a 2 by 2 square.

  • The boy doubles the side and gets area 16, four times too big.
  • Socrates joins the diagonals of four small squares: they make a tilted square of area 8.
  • Its side is 8=22\sqrt{8} = 2\sqrt{2}. Greek mathematicians later proved 2\sqrt{2} is irrational, the first such number anyone met.
the square on the diagonal of a square has twice its area, as in Plato's Meno
A 4 by 4 grid made of four 2 by 2 squares. One small square is shaded blue with area 4. An orange tilted square joins the midpoints of the outer edges, built from the diagonals of the four small squares, with area 8 and side equal to the diagonal, root 8 or 2 root 2.

Diagonals of 3D Shapes

In a solid there are two kinds, and they are often confused.

  • A face diagonal lies on one flat face.
  • A space diagonal runs through the inside between corners that share no face.
  • For a box ll by ww by hh, use Pythagoras twice:
d=(w2+h2)2+l2=l2+w2+h2d = \sqrt{\left(\sqrt{w^2 + h^2}\right)^2 + l^2} = \sqrt{l^2 + w^2 + h^2}
  • A cube with edge aa has 12 face diagonals of a2a\sqrt{2} and 4 space diagonals of a3a\sqrt{3}.

Examples of Diagonals

From counting to counting backwards, then lengths through a box and on a screen.

Example 1

How many diagonals does a decagon (10 sides) have, and how many run from a single vertex?

  1. Total: 10(10−3)2=35\frac{10(10-3)}{2} = 35.
  2. From one vertex: 10−3=710 - 3 = 7.

Final answer: 35 in total, 7 from each vertex.

Example 2

A student counts the diagonals of a pentagon like this: "each corner joins to the other 5 corners, so 5 × 5 = 25." Find the error and the right count.

  1. Corner A has only 4 other corners, and 2 of them (B and E) are neighbours.
  2. That leaves 2 diagonals per corner: 10 ends.
  3. Each diagonal is counted from both ends: 5×22=5\frac{5 \times 2}{2} = 5.

Final answer: 5 diagonals.

Example 3

A polygon has 27 diagonals. How many sides does it have?

  1. n(n−3)2=27\frac{n(n-3)}{2} = 27, so n2−3n−54=0n^2 - 3n - 54 = 0.
  2. (n−9)(n+6)=0(n - 9)(n + 6) = 0, and sides cannot be negative.

Final answer: 9 sides, a nonagon.

Example 4

Can a polygon have exactly 12 diagonals?

  1. n2−3n−24=0n^2 - 3n - 24 = 0 gives n=3±1052n = \frac{3 \pm \sqrt{105}}{2}, not a whole number.

Final answer: no. The counts jump from 9 to 14.

Example 5

Find the space diagonal of a box 12 cm long, 4 cm wide and 3 cm high.

  1. Across the 4 by 3 end: 16+9=5\sqrt{16 + 9} = 5 cm.
  2. Then along 12 cm: 52+122=169=13\sqrt{5^2 + 12^2} = \sqrt{169} = 13 cm.
the space diagonal of a 12 by 4 by 3 box is 13, found with two Pythagoras steps
A 12 by 4 by 3 box drawn in 3D. A green diagonal crosses the 4 by 3 end face, length 5, and an orange space diagonal runs from the front bottom corner to the far top corner, worked out as root of 5 squared plus 12 squared, root 169, equals 13.

Final answer: 13 cm, the longest rod the box can hold.

Example 6

A television is sold as "40-inch". Its screen is a rectangle in the ratio 16 : 9. How wide and how tall is it?

  1. Screens are measured along the diagonal. Let width =16k= 16k, height =9k= 9k.
  2. (16k)2+(9k)2=402(16k)^2 + (9k)^2 = 40^2, so 337k2=1600337k^2 = 1600 and k≈2.179k \approx 2.179.

Final answer: about 34.9 inches wide and 19.6 inches tall.

Tripping Points to Avoid

Most slips are counting slips.

Mistake 1: Counting the sides as diagonals

Where it slips in: Joining every pair of corners and counting all the lines.

Don't do this: Call all n(n−1)2\dfrac{n(n-1)}{2} segments diagonals.

The correct way: Leave out the nn sides. That is why each vertex gives n−3n - 3, not n−1n - 1.

Mistake 2: Forgetting to halve

Where it slips in: Counting by hand, corner by corner.

Don't do this: Stop at n(n−3)n(n - 3).

The correct way: Divide by 2: each diagonal has two ends.

Mistake 3: Mixing up face and space diagonals

Where it slips in: A box question asks for "the diagonal".

Don't do this: Use l2+w2\sqrt{l^2 + w^2} for the longest line through the box.

The correct way: A space diagonal uses all three edges: l2+w2+h2\sqrt{l^2 + w^2 + h^2}.

Mistake 4: Assuming every diagonal lies inside

Where it slips in: Sketching an L-shape or an arrowhead.

Don't do this: Skip a diagonal because it falls outside.

The correct way: Any segment joining non-adjacent corners counts, inside or out.

Why Diagonals Matter

Diagonals make shapes rigid and measure long reaches.

  • Bracing. One diagonal makes a frame rigid; n−3n - 3 diagonals from one corner split any polygon into triangles.
  • Screens. Phones and TVs are sold by their diagonal.
  • Packing and graphics. The space diagonal is the longest object a box holds; games use it for quick collision checks.
  • Checking a right angle. Builders measure both diagonals of a foundation: equal means the corners are square.

Conclusion

  • A diagonal joins two non-adjacent corners, inside or outside; a triangle has none.
  • A polygon has n(n−3)2\dfrac{n(n-3)}{2} diagonals, so no polygon has exactly 10 or 12.
  • Concave polygons send at least one diagonal outside.
  • Lengths come from Pythagoras: s2s\sqrt{2}, l2+w2\sqrt{l^2 + w^2}, l2+w2+h2\sqrt{l^2 + w^2 + h^2}.

A Practical Next Step

Draw a heptagon and its diagonals corner by corner. You should reach 14; if you reach 28, you drew each twice. Then dent one corner inwards and find the diagonal that falls outside.

  1. How many diagonals does a heptagon (7 sides) have?
  2. A polygon has 14 diagonals. How many sides does it have?
  3. Find the diagonal of a rectangle 6 cm by 8 cm.

Answers: (1) 14. (2) 7. (3) 10 cm. Stuck on 2? Solve the quadratic as in Example 3. For one more shape, read the diagonal of parallelogram formula.

To practise polygons and Pythagoras with a teacher, explore Bhanzu's math classes online.

Want a live Bhanzu trainer to work through diagonals, polygons and Pythagoras with your child? Book a free demo class, online globally, or in person at our McKinney, TX center.

Read More

Research Behind This Article

  1. Euclid, Elements, Book I, Proposition 34 (the "diameter" of a parallelogram bisects it), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
  2. Euclid, Elements, Book I, Proposition 47 (the Pythagorean theorem behind every diagonal length), D. E. Joyce, Clark University. mathcs.clarku.edu
  3. Plato, Meno, translated by Benjamin Jowett (the doubling of the square on the diagonal), MIT Internet Classics Archive. classics.mit.edu
  4. OpenStax, Contemporary Mathematics, Chapter 10: Geometry (polygons and their properties). openstax.org

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is a diagonal in simple words?
A straight line from one corner of a shape to another corner that is not next to it.
How many diagonals does a polygon with n sides have?
n(n−3)2\dfrac{n(n-3)}{2}: n−3n - 3 from each corner, halved so none is counted twice.
Does a circle have diagonals?
No, a circle has no corners. A line through its centre is a diameter.
Are the diagonals of a rectangle equal?
Yes. Both are l2+w2\sqrt{l^2 + w^2}, and they cut each other in half.
What is the difference between a diagonal and a side?
A side joins neighbouring corners and is part of the boundary. A diagonal joins non-neighbours and cuts across (or, in a concave shape, sometimes outside).
✍️ Written By
Vaishali Tomar
Vaishali Tomar
Subject Matter Expert
Vaishali Tomar is an educator and content specialist with over four years of experience teaching and developing learning resources for students from UKG to Grade 8. At Bhanzu, she creates lesson plans, assessments and educational content that simplify math through structured, student-friendly learning. She holds an M.Sc. in Computer Science and co-founded Qeemle, an online magazine, during her college years, which built her skills in content creation and editing.
LinkedIn
🔬 Reviewed By
Shikha Sharma
Subject Matter Expert
Related Articles
Book a FREE Demo ClassBook Now →