Centroid Calculator
The centroid is the geometric center of a shape: the point where a cutout made from uniform material would balance perfectly on a pin. For a triangle it is the average of the three vertices, for a circle it is simply the center, and for an irregular polygon it takes the shoelace formula, yet most online tools stop at the triangle and leave the rest to hand calculation.
This centroid calculator covers six shapes in one place: triangle, rectangle, circle, trapezoid, semicircle, and any custom polygon with as many vertices as you need. Every answer comes with the area and the full step-by-step working, so you can check the result instead of trusting it.
Symmetric trapezoid: the parallel sides are horizontal and the top base is centered over the bottom base.
Semicircle with its flat side on a horizontal line at the given y, arch above the flat side.
Enter the vertices in order, clockwise or counterclockwise, around the shape. Add as many as you need (minimum three).
Every mode validates its inputs: collinear triangle points, zero-area polygons, and non-positive radii return an explanation instead of a meaningless point.
Quick Answer
Key takeaways
- One tool, six shapes: five fixed shapes with closed-form formulas, plus a custom polygon mode that accepts any number of vertices.
- The polygon mode uses the shoelace first-moment formulas, not a plain average of the corners, which is wrong for irregular shapes.
- Every result shows the area and the step-by-step working, so a homework answer or an engineering check can be audited line by line.
- Degenerate inputs are caught: collinear triangle points, zero-area polygons, and non-positive radii return an explanation instead of a fake point.
- Quick Answer
- How to use the centroid calculator
- The formulas for all six shapes
- Worked example: centroid of an irregular pentagon
- Centroid, center of mass, and center of gravity: which one do you need?
- What competing centroid tools get wrong
- Frequently Asked Questions
- Add This Calculator to Your Website
- References
How to use the centroid calculator
Pick the shape from the tab row first. Each tab asks only for the measurements that shape actually needs: three vertices for a triangle, two opposite corners for a rectangle, a center and radius for a circle, the two bases and height for a symmetric trapezoid, and a center, flat-side height, and radius for a semicircle. Enter your coordinates in any consistent unit, press Calculate centroid, and read the point, the area, and the derivation underneath.
The custom polygon tab deserves one warning. Vertices must be listed in order around the outline, either clockwise or counterclockwise, exactly as you would walk the boundary. The pre-filled example is a 4 by 3 rectangle entered as (0, 0), (4, 0), (4, 3), (0, 3). Add or remove vertices with the buttons, but never list the corners in a scrambled order: the shoelace sums assume a simple, non-crossing outline, and a bow-tie ordering produces a signed area that cancels itself out.
If your shape is not one flat plate but a set of separate masses at known coordinates, that is a different problem with a different tool: the center of mass calculator (x, y coordinates) weights each point by its mass. Use this page when the geometry itself is the question; use that one when the weights are.
The formulas for all six shapes
Each mode uses the standard closed form for its shape. The trapezoid row is worth reading carefully, because it is the one most often printed with the wrong reference base elsewhere.
| Shape | Pre-filled example | Centroid | Area |
|---|---|---|---|
| Triangle | (0, 0), (6, 0), (0, 4) | (2.0000, 1.3333) | 12.0000 |
| Rectangle | Corners (0, 0) and (6, 4) | (3.0000, 2.0000) | 24.0000 |
| Circle | Center (0, 0), radius 5 | (0, 0) | 78.5398 |
| Trapezoid | Bases 10 and 6, height 4 | (5.0000, 1.8333) | 32.0000 |
| Semicircle | Center (0, 0), radius 5 | (0, 2.1221) | 39.2699 |
| Custom polygon | (0, 0), (4, 0), (4, 3), (0, 3) | (2.0000, 1.5000) | 12.0000 |
The trapezoid figure is the one to sanity-check any source against. A trapezoid has more area near its longer base, so the centroid must sit closer to that base: with bases 10 and 6 and height 4, the balance point is 1.8333 above the bottom, noticeably below the mid-height of 2. Any formula or page that puts this example above 2 is measuring from the top base while claiming to measure from the bottom. This tool measures from the bottom, and the result was cross-checked against the shoelace polygon formula on the same outline, which returns the identical 1.8333.
For shapes bounded by curves rather than straight edges, the same first-moment idea is carried by integration; the area between two functions calculator is the companion tool for the area side of that work, and the area of a semicircle page isolates the semicircle area on its own.
Worked example: centroid of an irregular pentagon
Take the pentagon with vertices, in order, (0, 0), (4, 0), (5, 3), (2, 5), (0, 3). No closed-form tab covers it, so the polygon mode earns its keep.
| Step | Calculation | Result |
|---|---|---|
| Shoelace cross sum | 0 + 12 + 19 + 6 + 0 | 37 |
| Signed area A | 37 / 2 | 18.5000 |
| Cx numerator | 0 + 108 + 133 + 12 + 0 | 253 |
| Cx | 253 / (6 x 18.5) = 253 / 111 | 2.2793 |
| Cy numerator | 0 + 36 + 152 + 48 + 0 | 236 |
| Cy | 236 / (6 x 18.5) = 236 / 111 | 2.1261 |
The centroid (2.2793, 2.1261) sits inside the pentagon, pulled slightly right of center by the (5, 3) corner. Try the tempting shortcut instead: averaging the five vertices gives (2.2000, 2.2000). That point is close here, which is exactly why the shortcut survives in print, but it is the centroid of five equal point masses at the corners, not of the area. Stretch one corner further out and the two answers drift apart, because area grows with the square of the coordinates while the vertex average grows only linearly.
Centroid, center of mass, and center of gravity: which one do you need?
The three terms describe the same point for a uniform flat plate, which is why they are used so loosely. Keep them apart and the right tool is obvious. The centroid is a property of the shape alone. The center of mass is a property of the object: give one region more density and the center of mass moves toward it while the centroid does not. The center of gravity is the center of mass read through a gravity field, identical for anything human-sized. This calculator answers the geometry question, for plates, sections, and outlines. The moment your problem includes unequal masses or densities, it stops being this problem.
In practice the centroid shows up in structural sections (the neutral axis of a beam passes through it), in plate and sheet layouts (where a part will balance, hang, or tip), in GIS and mapping (the centroid of a parcel or district), and in graphics, where rotating a shape around its centroid keeps it visually anchored. In every case the input is an outline or a standard shape, which is what the six tabs cover.
What competing centroid tools get wrong
Error 1: averaging the vertices and calling it the polygon centroid. Widely read how-to pages print the polygon formula as the sum of the x coordinates divided by the number of vertices. That is the centroid of a set of points, not of the enclosed area, and it fails exactly on the irregular shapes people need help with. The shoelace first-moment sums in the polygon tab are the correct area formulas.
Error 2: the trapezoid formula measured from the wrong base. The expression h(2a + b) / (3(a + b)) circulates as the distance from the longer or bottom base; it is actually the distance from the opposite base. On the bases-10-and-6 example it returns 2.1667 from the bottom, above mid-height, which is impossible for a shape with more area at the bottom. This tool uses h(b1 + 2b2) / (3(b1 + b2)) from the bottom base and returns 1.8333, verified against the polygon formula.
Error 3: triangle-only tools. Most ranking centroid calculators stop at the triangle. Real outlines are quadrilaterals, sections, and parcels; the rectangle, trapezoid, semicircle, and free polygon modes here cover them without a second site.
Error 4: silent nonsense on degenerate input. Three collinear points have no centroid, but a naive average still prints one. This calculator checks for zero area in the triangle and polygon modes and explains the problem instead.
Frequently Asked Questions
The geometric center of a shape: the mean position of all the points in its area, and the point where a cutout made from uniform material would balance on a pin. For a triangle it is also where the three medians meet, dividing each median in a 2 to 1 ratio.
Yes. For concave shapes, such as an L-shaped or crescent polygon, the area centroid can sit in the notch or the empty space beyond the boundary. It is still the balance point of the area, and the custom polygon mode computes it correctly for concave outlines entered in order.
List the vertices in order, clockwise or counterclockwise, in the custom polygon tab. The tool applies the shoelace formula for the signed area, then the first-moment sums for the coordinates, and prints every step. Do not scramble the order: crossing edges make the signed area meaningless.
If the three points lie on one straight line, the enclosed area is zero and there is no triangle to balance. The calculator detects the collinear case and says so, instead of returning the average of the points as if it were a centroid.
The centroid is purely geometric: it depends only on the shape. The center of mass weights each part by its density, so for a uniform plate the two points coincide, and for a plate that is thicker or denser on one side the center of mass shifts toward that side while the centroid stays put.
On the axis of symmetry, at a distance of 4r divided by 3 pi from the center of the flat side, measured into the arch. For a radius of 5 that is about 2.1221 units above the diameter line. The semicircle tab computes it directly.
Because the same expression is printed with two different reference bases. The distance from the bottom base is h(b1 + 2b2) divided by 3(b1 + b2); the mirrored form h(2b1 + b2) divided by 3(b1 + b2) is the distance from the top base. Several popular pages label one as the other. This calculator measures from the bottom base, and the figure was verified against the shoelace polygon formula.
No. It covers flat 2D shapes: triangle, rectangle, circle, trapezoid, semicircle, and polygons. For a solid, the centroid needs volume integrals or decomposition into known solids, which is a different tool.
Add This Calculator to Your Website
References
- Wikipedia, "Centroid": the standard reference for the definition of the centroid as the mean position of all points in a figure, the polygon centroid formulas, and the distinction from center of mass. Wikipedia: Centroid. Accessed October 2026.
- ExcelCalcs, "Properties of a general polygon": engineering reference for computing area, centroid, and second moments of arbitrary plane polygons with the Gauss (shoelace) area method. ExcelCalcs: Properties of a general polygon. Accessed October 2026.
- Trapezoid centroid equation sheet (worked examples, citing the Wolfram MathWorld form): the centroid distance h(b + 2a) / (3(a + b)) measured from the base of length b, the convention this calculator uses for its trapezoid mode. Trapezoid centroid equation sheet (PDF). Accessed October 2026.
