Centroid Calculator

Find the centroid (x̄, ȳ) for common 2D shapes. Choose a shape mode, enter dimensions, and get the centroid relative to the shown datum.

Configuration

Select the shape type you want to compute the centroid for, and choose output units.

Inputs

Results

Practical Guide

Centroid Calculator: Find \((\bar{x}, \bar{y})\) for Common and Composite Shapes

This guide shows how to use the Centroid Calculator correctly, what assumptions it makes, and how to sanity-check results for standard shapes and composite areas—exactly the way centroid problems show up in real structural and mechanical design.

6–8 min read Updated 2025 Statics • Mechanics • Structures

Quick Start

  1. 1 Decide if your problem is a single shape (rectangle, triangle, circle, trapezoid, etc.) or a composite area made of multiple parts and/or holes.
  2. 2 Set a clear origin and coordinate axes. Most centroid errors come from inconsistent reference points. The calculator assumes all inputs are measured from the same origin.
  3. 3 For a single shape, pick the shape type (Mode) and enter the required dimensions. Unused fields hide automatically.
  4. 4 For a composite section, enter each part’s area \(A_i\) and its centroid location \((x_i, y_i)\). Use negative area for holes/cutouts.
  5. 5 Choose output units and compute. The calculator returns the centroid \((\bar{x},\bar{y})\).
  6. 6 Run a quick sanity check: does \((\bar{x},\bar{y})\) lie in a reasonable location (often on symmetry axes)? If not, re-check your origin and signs.

Tip: Sketch the shape with dimensions and mark your origin before typing anything. A 15-second sketch prevents 15 minutes of debugging.

Warning: If you mix coordinate reference points between parts in a composite area, the weighted average will be wrong even if every part centroid is correct.

Choosing Your Method

Method A — Formula for a Single Shape

Use this when the cross-section is a single standard geometry with well-known centroid formulas.

  • Fastest path from dimensions to \((\bar{x},\bar{y})\).
  • Great for homework, quick checks, and early-stage design.
  • Less setup—no need to compute intermediate areas or part centroids.
  • Limited to common shapes (rectangles, triangles, circles, trapezoids, segments).
  • Assumes uniform density/thickness in the plane.
Example core idea: \(\bar{x} = \frac{b}{2}, \; \bar{y}=\frac{h}{2}\) for a rectangle.

Method B — Composite Area (Area-Weighted Average)

Use this for built-up sections: T-beams, L-angles, channels, plates with holes, or any shape you can split into simpler parts.

  • Handles almost any geometry if you can partition it.
  • Supports cutouts by using negative area.
  • Aligns with how centroid is used in moment of inertia and bending stress.
  • Requires careful bookkeeping of each part centroid.
  • More prone to reference-axis mistakes.
\(\bar{x}=\dfrac{\sum A_i x_i}{\sum A_i},\quad \bar{y}=\dfrac{\sum A_i y_i}{\sum A_i}\)

Method C — Coordinate Integration (Advanced)

Used when the boundary is described by a function or curve and a closed-form centroid is needed.

  • Exact for non-standard shapes (parabolas, splines, variable thickness).
  • Matches finite-element or CAD derivations.
  • More math; beyond most quick-design needs.
  • Not necessary if you can decompose into parts.
\(\bar{x}=\dfrac{1}{A}\int x\,dA,\quad \bar{y}=\dfrac{1}{A}\int y\,dA\)

The calculator primarily supports Method A and Method B, because they cover nearly all practical centroid lookups in statics, structural design, and machine components.

What Moves the Number the Most

Reference origin

Every \(x_i\) and \(y_i\) must be measured from the same origin. Shifting the origin shifts \((\bar{x},\bar{y})\) by the same amount.

Area distribution

The centroid pulls toward larger areas. Doubling a part’s area doubles its influence in \(\sum A_i x_i\) and \(\sum A_i y_i\).

Negative areas (holes)

A void subtracts area and “pushes” the centroid away from the cutout. Forgetting the minus sign is a classic failure mode.

Symmetry

If the shape is symmetric about an axis, the centroid lies on that axis. Any result off that line indicates a setup error.

Dimension sensitivity

Some shapes shift more with certain dimensions: e.g., a triangle’s centroid moves linearly with height but also depends on orientation.

Partition choices

For composites, different partitions should produce the same centroid if all \(A_i, x_i, y_i\) are consistent. Use this as a check.

Worked Examples

Example 1 — Single Right Triangle

  • Shape: Right triangle with legs along axes
  • Base: \(b = 300 \text{ mm}\)
  • Height: \(h = 200 \text{ mm}\)
  • Origin: At right-angle corner

For a right triangle with legs on the axes, the centroid is located one-third of the way from each leg:

\[ \bar{x}=\frac{b}{3},\qquad \bar{y}=\frac{h}{3} \]

1
Compute: \(\bar{x} = 300/3 = 100 \text{ mm}\)
2
Compute: \(\bar{y} = 200/3 \approx 66.7 \text{ mm}\)

Enter Mode = “Right Triangle,” then input base and height. The calculator should return approximately \((100, 66.7)\) mm. If you rotate the triangle, the centroid location relative to the origin changes—so be sure your origin matches the leg orientation.

Example 2 — Composite L-Section (Two Rectangles)

  • Shape: L-section made from two rectangles
  • Rect 1: \(200 \text{ mm} \times 20 \text{ mm}\) (horizontal flange)
  • Rect 2: \(20 \text{ mm} \times 160 \text{ mm}\) (vertical web)
  • Origin: Outer corner of the L (bottom-left)
  • Overlap: The 20×20 corner is shared—count it only once by defining rectangles that don’t double-count.

Partition into two non-overlapping rectangles:

  • Part A: Horizontal rectangle \(b=200\), \(h=20\). Area \(A_1=200\cdot20=4000\text{ mm}^2\). Centroid at \((x_1,y_1)=(100,10)\).
  • Part B: Vertical rectangle \(b=20\), \(h=140\) stacked above the flange. Area \(A_2=20\cdot140=2800\text{ mm}^2\). Centroid at \((x_2,y_2)=(10,20+70)=(10,90)\).

\[ \bar{x}=\frac{A_1x_1+A_2x_2}{A_1+A_2},\qquad \bar{y}=\frac{A_1y_1+A_2y_2}{A_1+A_2} \]

1
Total area: \(A=4000+2800=6800\text{ mm}^2\)
2
\(\bar{x}\): \(\frac{4000\cdot100+2800\cdot10}{6800} =\frac{400000+28000}{6800} \approx 62.9\text{ mm}\)
3
\(\bar{y}\): \(\frac{4000\cdot10+2800\cdot90}{6800} =\frac{40000+252000}{6800} \approx 42.9\text{ mm}\)

In composite mode, enter \(A_1, x_1, y_1\) and \(A_2, x_2, y_2\). The centroid should fall inside the “knee” of the L, closer to the larger flange—exactly what \(\bar{x}\approx63\) mm and \(\bar{y}\approx43\) mm indicate.

Common Layouts & Variations

Centroid problems often repeat in a few standard configurations. This table summarizes practical patterns and how to treat them in the calculator.

ConfigurationHow to ModelUse CasesNotes / Pros & Cons
Plate with circular holeComposite: outer plate (+), hole (−)Bolted connections, access holesUse negative area for hole; centroid shifts away from void.
T-beam sectionComposite: flange (+) + web (+)RC beams, steel shapesWatch overlap—define parts so areas don’t double-count.
Channel / C-shapeComposite: three rectanglesSteel cold-formed membersSymmetry about one axis often gives one coordinate immediately.
Quarter/semicircle areasSingle shape modeFillets, curved bracketsCentroid is not at radius/2; use built-in formula.
Trapezoid plateSingle trapezoid or two triangles + rectangleEarth pressure diagrams, tapered membersEither method works; results should match within rounding.
  • Label each part on your sketch with \(A_i, x_i, y_i\).
  • Confirm sign convention for holes before computing.
  • Exploit symmetry to reduce chances of mistakes.
  • Partition without overlaps unless you intentionally correct for them.
  • Check that \(\sum A_i\) is positive for solids.
  • Keep units consistent across all parts.

Specs, Logistics & Sanity Checks

Assumptions

  • Area is uniform in thickness and density (2D centroid).
  • All coordinates are referenced to the same origin.
  • Shapes are idealized (perfect lines/arcs).

Common Pitfalls

  • Using midpoints instead of true part centroids.
  • Forgetting to subtract holes (negative area).
  • Mixing inches and feet (or mm and m) between parts.
  • Double-counting overlapping regions.

Sanity Checks

  • Centroid lies on symmetry axes.
  • Centroid is within the convex hull of solid parts (unless holes dominate).
  • Re-partitioning yields the same result.
  • Coordinates fall within reasonable bounds of the geometry.

Engineering tip: If you’re using the centroid for moment of inertia or bending stress, keep the centroid coordinates to at least 3 significant figures before plugging into later steps.

Design note: For composite sections that will be fabricated, verify that real-world welds, fillets, or gussets don’t shift the centroid enough to matter for your load path.

Frequently Asked Questions

What is the centroid in engineering?
The centroid is the geometric “balance point” of a 2D area. It is the point where the first moments of area about both axes are zero, and it’s used for bending, shear flow, stability, and locating neutral axes.
How do I find the centroid of a composite shape?
Split the shape into simpler parts, compute each part’s area \(A_i\) and centroid \((x_i,y_i)\), then use \(\bar{x}=\frac{\sum A_ix_i}{\sum A_i}\) and \(\bar{y}=\frac{\sum A_iy_i}{\sum A_i}\). Use negative \(A_i\) for holes.
Does the centroid change if I move the origin?
The physical centroid doesn’t change, but the numerical coordinates do. If you shift your origin by \((\Delta x,\Delta y)\), your reported centroid shifts by the same amount.
Why is my centroid outside the shape?
For solid shapes without large voids, this usually indicates an error in coordinates, signs, or partition overlaps. For shapes with big holes or cutouts, the centroid can legitimately fall outside the remaining material.
How do holes affect centroid calculations?
Treat each hole as a part with negative area. This subtracts from total area and first moments, shifting the centroid away from the void location.
What’s the difference between centroid and center of mass?
For uniform density and thickness, they’re the same. If density varies, the center of mass is weighted by mass distribution, while the centroid is purely geometric.
Can this calculator be used for 3D centroids?
This tool is for plane (2D) areas. For 3D solids, you’d use volume-weighted averages and 3D centroid formulas.
Scroll to Top