The Centroid Calculator computes the centroid coordinates (x̄, ȳ) of a shape or composite area using weighted averages of sub-areas. It’s based on the center-of-area principle: bigger areas pull the centroid closer to them.
Use it for engineering, architecture, and physics problems where you need the balance point of a 2D region made from rectangles, triangles, and other standard parts.
What “centroid” means (and why it matters)
The centroid is the geometric “balance point” of a 2D area (or the center of mass when density is uniform). If you could support the shape at its centroid, it would balance under gravity in the plane.
For thin plates and uniform density, the centroid depends only on the area and where each piece sits—not on the material.
Centroid formulas for composite areas
For a composite area split into n non-overlapping parts, the centroid is the weighted average of each part’s centroid:
- x̄ = (Σ(Ai · xi)) / ΣAi
- ȳ = (Σ(Ai · yi)) / ΣAi
Where:
- Ai = area of part i (use negative areas for holes/subtractions)
- xi, yi = centroid coordinates of part i relative to the same origin
- ΣAi = total signed area
Coordinate system and sign convention
Pick an origin (0,0) and keep it consistent for every part. If a part is removed (a hole), enter its area as a negative area or use the calculator’s “subtraction” option.
This sign approach makes the weighted averages work automatically.
How the calculator computes results
The calculator uses the inputs you provide for each part’s area and centroid position. It then calculates:
| Step | Computation |
|---|---|
| 1) Total area | Atotal = ΣAi |
| 2) Weighted x-sum | Σ(Ai · xi) |
| 3) Weighted y-sum | Σ(Ai · yi) |
| 4) Centroid | x̄ = Σ(Ai · xi) / Atotal, ȳ = Σ(Ai · yi) / Atotal |
Units: how to avoid common mistakes
Centroid coordinates have the same length units as your input coordinates (mm, cm, inches, etc.). Areas have squared units (mm², cm², in²). The calculator keeps units consistent by applying conversions.
To avoid errors:
- Choose one length unit for all x and y inputs.
- Choose one area unit for all area inputs.
- Use the same sign convention for holes/subtractions.
Practical examples (real use-cases)
Example 1: L-shaped plate from two rectangles
Suppose you have an L-shaped area made by combining two rectangles. Set the origin at the corner where the arms meet. Compute each rectangle’s area and its own centroid coordinates (for rectangles, each centroid is at its geometric center).
Then enter each part’s Ai, xi, and yi into the calculator. The result gives the centroid of the entire L shape.
Example 2: Rectangular plate with a rectangular hole
For a plate with a cut-out, treat the hole as a negative area. Enter the outer rectangle as a positive part and the inner cut-out as a negative part, using the same origin and coordinate system.
The calculator returns the centroid shift caused by the missing material—useful for load paths, mounting points, and stress analysis.
When centroid methods work best
This centroid approach works well when you can split the shape into simple parts with known centroids. It also works for composite shapes with holes as long as you use consistent coordinates and correct signs.
If your geometry is complex (curved boundaries, varying thickness, non-uniform density), you may need more advanced methods like integration or numerical techniques.
Frequently Asked Questions
What is a centroid calculator used for?
A centroid calculator finds the centroid coordinates (x̄, ȳ) of a 2D area by using weighted averages. It’s used in engineering and physics to locate the balance point of composite shapes, helping with statics, moments, beam mechanics, and the center of mass for uniform density plates.
Do I need to know the centroid of each part?
Yes. For a composite centroid, each part needs its own centroid coordinates (xi, yi). You can compute these for standard shapes like rectangles and triangles, then combine them using the area-weighted formulas. The calculator automates the final weighted averages.
How do I handle holes or cutouts?
Treat holes as negative areas. Enter the cut-out part with a negative area so the weighted sums subtract its influence. Keep the same origin and coordinate system for the hole centroid. This sign convention makes the centroid shift correctly toward the remaining material.
What units should I enter?
Enter x and y in the same length unit (like mm or inches) and area in a matching squared unit (like mm² or in²). The centroid result will use your length unit. The calculator converts units so you can mix inputs safely when needed.
What if the total area is zero?
If the signed total area ΣAi equals zero, the centroid is undefined because the weighted average divides by zero. This can happen when positive and negative areas cancel exactly. The calculator should flag this case so you can check your inputs and sign convention.



