Skip to content

Home / Facility Planning / Center of Gravity

Center of Gravity / Facility Location Calculator

Find the load-weighted center of your demand and supply points so you know where one plant, warehouse, or distribution center should sit. Enter each location as a grid coordinate or a latitude and longitude, add its volume and an optional freight rate, and the tool returns the center of gravity, the unweighted centroid for contrast, the total weighted distance in ton-miles, and an optional Weiszfeld refinement toward the true minimum. Free, no sign-up, and your numbers stay in your browser.

In short: the center of gravity method places one facility at the point where the sum of weight times distance is lowest. It weights every market by its load, so a high-volume city pulls the center toward it. Enter your locations and weights to read the center of gravity, the ton-miles it carries, and how far that point sits from the plain unweighted average that ignores volume.

Inputs

One row per location. X and Y are grid coordinates, or in lat/long mode X = longitude and Y = latitude. Weight is volume, tons, or shipments. Rate is optional and used only when weighting is volume x rate.

LocationXYWeightRate

Center of gravity

(5.31, 5.19)place the facility here

Unweighted centroid
(5.25, 5.00)
Total weighted distance
10,757.9 weighted units
Refined point (Weiszfeld)
(5.30, 5.12) (0.0% less distance)
Total weight
2,600
Locations used
4

Locate the facility near (5.31, 5.19). The unweighted center would be (5.25, 5.00), which ignores volume.

What the calculator computes

Enter each demand or supply point as a row: a name, an X and Y coordinate or a longitude and latitude, the load it carries, and an optional freight rate. Pick a coordinate mode, a distance metric, and a weighting basis, and the tool returns the center of gravity, the load-weighted point where one facility minimizes weight times distance. It also shows the plain unweighted centroid so you can see how much volume shifts the answer, the total weighted distance the layout carries, and a refined Weiszfeld point that steps closer to the true minimum.

The result is a starting zone, not a street address. The center of gravity answers one question well: given where your volume sits and how heavy each market is, where does a single facility sit closest to all of it on a weighted basis. It does not judge land price, labor, or roads. Read it as the middle of the demand, the place to begin a site search, and then test real candidate sites around it against cost and feasibility.

Why the center of gravity method works

Transport cost rises with both the weight you move and the distance you move it. A market that ships twice the volume of another matters twice as much to your freight bill for the same distance. The center of gravity method takes that idea directly: it places the facility at the average of all the demand points, but each point is pulled with a force equal to its load. Heavy markets pull hard, light markets pull gently, and the point settles where the pulls balance.

The physical picture is a flat map with a weight pinned at each market, tied by strings to a single ring. Let go, and the ring slides to the spot where the weighted tension is even. That balance point is the center of gravity. It is the same math a physicist uses to find the balance point of an object, applied to shipments instead of mass, which is where the name comes from.

How the weighted centroid is figured

The center of gravity has two coordinates, and each is a weighted average. The X coordinate is the sum of every point’s weight times its X, divided by the total weight. The Y coordinate is the same with Y. In symbols, Cx = sum(Wi times Xi) / sum(Wi) and Cy = sum(Wi times Yi) / sum(Wi), where Wi is the load at point i and (Xi, Yi) is its position.

The default example makes this concrete. Four markets carry loads of 600, 800, 500, and 700, for a total weight of 2,600. For the X coordinate, sum the products 2 times 600, 9 times 800, 8 times 500, and 2 times 700, which gives 13,800, then divide by 2,600 to get 5.31. For the Y coordinate, sum 8 times 600, 7 times 800, 2 times 500, and 3 times 700, which gives 13,500, then divide by 2,600 to get 5.19. So the center of gravity sits at (5.31, 5.19), leaning toward the East market because it carries the heaviest load.

Weighted versus simple centroid

The most common error is to average the coordinates and stop there, treating every market as equal. That plain average is the unweighted centroid. For the default points it is (5.25, 5.00), the middle of the four dots on the map with no regard for how much each ships. It answers a geometry question, not a logistics one.

The weighted center at (5.31, 5.19) sits a little north and east of that plain middle, because the East market at load 800 and the North market at load 600 pull it that way. The gap looks small on a tidy four-point grid, but on a real network where one city ships five times another, the two points can fall far apart, and the unweighted one sends freight the wrong way. Always weight by load. A centroid that ignores volume is the fastest way to put a warehouse in the wrong place.

Grid coordinates versus latitude and longitude

The tool accepts two coordinate systems. Grid mode uses plain X and Y numbers, which suits a sketch, a warehouse floor, a regional map with a ruled overlay, or any case where you set your own scale. It is quick to enter and easy to reason about, and the distance between points is measured in the same grid units you typed.

Latitude and longitude mode uses real map coordinates, with X as longitude and Y as latitude. Here the tool measures distance along the curve of the earth with the Haversine formula rather than as flat geometry, so the answer is in kilometers or miles. Use lat/long when your markets are cities spread across a region or a country and you want the center returned as a real coordinate you can drop into a map. You can read the latitude and longitude of any city from a map service and paste the pair straight into a row.

Distance metrics: Euclidean, rectilinear, and geodesic

Distance can be measured three ways, and the choice changes the total weighted distance the tool reports. Euclidean distance is the straight line between two points, the square root of the squared coordinate gaps. It is the default and suits open regions where freight is not boxed into a grid. Rectilinear distance, also called Manhattan distance, is the sum of the horizontal and vertical gaps, which fits a street grid or an aisle layout where travel follows right angles.

Geodesic distance is for latitude and longitude, where a straight line on a flat map is wrong because the earth curves. The Haversine formula returns the great-circle distance in kilometers or miles. Whichever metric you pick, remember that none of them is road distance. A truck follows highways, not a straight line or a perfect grid, so the real haul is longer than any of these. Apply a detour factor when you read the numbers, covered further below.

Ton-miles, ton-kilometers, and weighted distance

The total weighted distance is the number that ranks one layout against another. It is the sum over all points of weight times distance from that point to the center, so it carries a unit of load times distance. When the load is tons and the distance is miles, that unit is ton-miles; when it is tons and kilometers, it is ton-kilometers. Ton-miles are the standard currency of freight planning because they track cost more honestly than distance alone.

For the default layout at the center (5.31, 5.19), each market contributes its load times its straight-line distance to that point. The North market at load 600 sits about 4.34 units away and adds roughly 2,605. The East market at load 800 adds about 3,288, the South market about 2,086, and the West market about 2,778. The four contributions sum to 10,757.9 weighted units, the figure the tool shows. Move the facility anywhere else and that sum climbs, which is the whole point of finding the center.

Cost weighting: volume times rate

Volume is a fair weight when every lane costs the same per unit of distance, but rates differ. A refrigerated lane, a hazardous load, or a route with a return-haul shortage all cost more per ton-mile than a plain dry van. When the rate varies, weight each point by volume times its rate, so a costly lane pulls the center harder than its tonnage alone would suggest. Set the weighting to volume times rate and fill the rate column to switch the math to this basis.

This matters most where freight is not symmetric. In many networks the outbound rate to a market is far higher than the inbound rate from a supplier, so the same tonnage does not carry the same cost. Weighting by volume times rate lets the expensive direction dominate, which is often the correct call. If every rate is equal, the rate column changes nothing and the answer matches the volume-only center, so there is no harm in leaving it blank when rates are flat.

The Weiszfeld refinement

The plain Cx and Cy formula has a quiet catch. It does not minimize the sum of weighted distances. It minimizes the sum of weighted squared distances, which is a slightly different point. For rough planning the gap is usually small, but if you want the true minimum of ton-miles, the point that logisticians call the Weber point, you have to refine.

The refinement is Weiszfeld’s algorithm. It starts from the plain centroid, then re-weights each point by its load divided by its current distance to the center, and recomputes the average. Points that are far away lose influence, points that are close gain it, and after a few passes the center settles on the true weighted-distance minimum. In the default layout the refined point is (5.30, 5.12), which cuts the total distance by about 0.0 percent, because four well-spread points leave almost nothing to gain. On a lopsided network with one dominant market, the refinement can move the point more and shave a real slice off the ton-miles.

Center of gravity versus load-distance

Two methods get confused, and they answer different questions. The center of gravity computes an ideal point out of thin air: it hands you a coordinate that may or may not have a road, a building, or a plot of land on it. The load-distance method works the other way. You bring a short list of real candidate sites, each with a known location, and it scores every one by the sum of load times distance, then ranks them so you can pick the lowest.

The two work best in sequence. Use the center of gravity first to find the zone your volume points to, then draw a circle around it and gather the genuine sites inside, the industrial parks, the vacant warehouses, the plots for sale. Score those with load-distance and you get a feasible answer that respects the ideal without pretending the ideal is buildable. The center of gravity finds the target, load-distance picks the site.

Five worked examples

Example 1: the baseline weighted center

Start with the four default markets: North at (2, 8) with load 600, East at (9, 7) with 800, South at (8, 2) with 500, and West at (2, 3) with 700, for a total weight of 2,600. The X coordinate is 13,800 divided by 2,600, which is 5.31, and the Y coordinate is 13,500 divided by 2,600, which is 5.19. The center of gravity sits at (5.31, 5.19). Its total weighted distance is 10,757.9 units, the sum of each load times its straight-line distance to that point. This is the point a single facility should aim for, closest to all four markets once their volumes are counted.

Example 2: weighted against unweighted, why volume matters

Take the same four points but drop the weights and average the raw coordinates. The X is (2 plus 9 plus 8 plus 2) divided by 4, which is 5.25, and the Y is (8 plus 7 plus 2 plus 3) divided by 4, which is 5.00. So the unweighted centroid is (5.25, 5.00). Compare it to the weighted center at (5.31, 5.19). The weighted point sits north and east of the plain middle, pulled by the East market at load 800 and the North market at load 600. On this neat grid the shift is small, but it is real, and it points the facility toward where the tonnage actually is rather than the middle of the map.

Example 3: cost weighting shifts the point

Now suppose the East market is served on a premium lane that costs twice the rate of the others. Switch the weighting to volume times rate and give East a rate of 2 while the rest stay at 1. Its effective weight becomes 800 times 2, or 1,600, so its pull on the center roughly doubles. The X coordinate now leans further toward East’s position at 9, and the whole center of gravity slides east and a little north of the volume-only answer. The lesson is that the point follows cost, not just tonnage, so a market with an expensive lane deserves a facility closer to it even if its raw volume is modest.

Example 4: latitude and longitude with geodesic distance

Switch to latitude and longitude mode and enter the same four markets as real coordinates, with X as longitude and Y as latitude. Pick the geodesic metric and the tool measures each distance along the curve of the earth with the Haversine formula, returning the total in kilometers or miles rather than grid units. The center of gravity comes back as a real latitude and longitude you can drop onto a map. The weighted-average logic is unchanged, but the distances are now true earth distances, which is what you need when the markets are cities hundreds of kilometers apart and flat geometry would understate the far ones.

Example 5: adding a high-volume market and watching the center move

Add a fifth row for a new market at (9, 3) with a load of 1,500, larger than any existing point. The total weight climbs from 2,600 to 4,100, and the sums in both coordinates gain a heavy pull toward the lower-right of the grid. The center of gravity moves noticeably east and down, away from the old (5.31, 5.19), because the new market outweighs the rest. This is the method’s core behavior in one step: the center always chases the heaviest demand, so a single large customer or a fast-growing region can justify relocating the facility on its own.

Three expert tips

Turn straight-line distance into road distance

Every metric the tool offers measures a straight line or a grid, never a real road, so the ton-miles it reports understate the haul a truck actually drives. Roads bend around rivers, mountains, and city limits, and the extra distance is real fuel and real hours. Apply a detour factor when you interpret the output: multiply the straight-line distance by about 1.2 in open country and up to 1.5 in dense or mountainous terrain. The center of gravity itself barely moves, since the factor scales all lanes together, but the cost you attach to it should reflect the longer road, not the crow-flight line.

Keep weights and coordinates in one consistent system

The math trusts your inputs, so a single mismatched row throws the whole answer off. Use the same weight unit for every market, whether that is tons, pallets, shipments, or annual volume, and never mix them in one run. Keep the coordinate system consistent too: all grid or all latitude and longitude, with longitude in the X column and latitude in the Y column when you use map mode. A market entered in the wrong unit or with its coordinates swapped will drag the center toward a place your volume never justified, and the error is easy to miss because the tool still returns a tidy-looking point.

Treat the point as a zone, then test real sites

The center of gravity is a starting point, not a verdict. It weighs only transport, and it can land in a lake, on a runway, or in the middle of a protected forest. Draw a circle a few miles or kilometers around it and gather the sites that actually exist inside, then score those against the things the method ignores: land price, labor supply, tax incentives, road access, and building stock. Use the load-distance method to rank the feasible sites by weighted distance so you keep the transport logic while respecting reality. The ideal point guides the search; a real site wins the decision.

Reading the results panel

The headline is the center of gravity, the coordinate where a single facility minimizes weighted distance. Below it, the unweighted centroid is shown for contrast, so you can see at a glance how far volume has pulled the answer away from the plain geometric middle. A wide gap between the two tells you the network is lopsided, with a few heavy markets steering the result, which is exactly when weighting earns its keep.

The total weighted distance sets the scale of the layout in ton-miles or ton-kilometers, the number to compare against any alternative site. The refined Weiszfeld point and its percent improvement show whether the plain formula left anything on the table; a near-zero improvement means the centroid was already close to the true minimum. The total weight and the count of locations confirm the tool read every row you entered, a quick check that no market was dropped or double-counted before you trust the point.

The limits of the method

The center of gravity is a transport model and nothing more. It assumes cost rises with weight times distance and ignores everything else that decides a site. Land and lease prices, labor availability and wages, property taxes and incentives, utility supply, and highway access all sit outside the math, yet any one of them can outweigh a few ton-miles. A point that is perfect on freight can be impossible or expensive on the ground, so it never settles a decision by itself.

Two more limits matter. The method places one facility only. For a network of several plants or warehouses serving overlapping regions you need a p-median or network optimization model that assigns each market to its nearest facility, not a single centroid. And the straight-line basis ignores real roads and the inbound-versus-outbound rate gap, both of which the cost weighting and the detour factor only partly correct. Read the point as the middle of your demand, a strong place to begin, and let cost and feasibility finish the job.

Where this calculator fits

It suits anyone choosing where to put a facility that serves many locations: supply chain and logistics planners siting a distribution center, operations managers placing a plant near its markets or suppliers, and students working through a facility-location assignment. Planners use it to find the freight-optimal zone before a site search, so the search has a defensible center. Managers use the weighted-distance output to compare a proposed site against the ideal and put a number on the penalty of choosing convenience over cost.

Because the tool takes grid coordinates or real latitude and longitude, works in miles or kilometers, and offers volume or cost weighting, it fits a quick classroom exercise and a real network study alike. The scatter plot shows the demand points sized by load with the center marked, so the balance is visible, not just tabulated, which makes the result easy to explain to a team that has to act on it.

Common mistakes to avoid

The first mistake is averaging coordinates without weighting, which produces the unweighted centroid and quietly ignores the volume that should drive the answer. The second is mixing units across rows, tons in one market and pallets in another, or swapping latitude and longitude, either of which drags the center toward a place the real demand never supports. The third is treating the point as a final address rather than a zone, and building a case around a coordinate that turns out to sit on water or on land nobody will sell.

A fourth is forgetting the detour factor and costing the layout on straight-line distance, which understates every haul and flatters the plan. A fifth is stretching the method past one facility, trying to read two warehouses out of a single centroid when the problem calls for a p-median model. Weight by load, keep units clean, scale distance to real roads, treat the point as a starting zone, and use the right model for more than one site, and the center of gravity earns its place at the front of a location study.

Frequently asked questions

What is the center of gravity method?

The center of gravity method is a facility-location technique that places one plant, warehouse, or distribution center at the load-weighted average position of its demand or supply points. Each location is weighted by the volume it ships or receives, so heavy markets pull the point toward them and light markets pull less. The result is the coordinate where a single facility sits closest to all the markets on a weighted basis, which is the point that minimizes transport cost when cost rises with weight times distance. It is a starting zone for a site search, not a final address.

What is the formula for the center of gravity?

The center of gravity has two coordinates, each a weighted average. The X coordinate is Cx = sum(Wi times Xi) / sum(Wi), and the Y coordinate is Cy = sum(Wi times Yi) / sum(Wi), where Wi is the load at point i and (Xi, Yi) is its position. In words, multiply each point’s coordinate by its weight, add those products across all points, and divide by the total weight. For the default four markets the X sum is 13,800 over a total weight of 2,600, giving 5.31, and the Y sum is 13,500 over 2,600, giving 5.19, so the center sits at (5.31, 5.19).

What is the difference between a weighted and a simple centroid?

A simple centroid averages the raw coordinates and treats every market as equal, so it answers a geometry question and ignores volume. A weighted centroid multiplies each coordinate by the market’s load before averaging, so a high-volume city pulls the point toward it. For the default layout the simple centroid is (5.25, 5.00) and the weighted center is (5.31, 5.19). On a real network where one city ships several times another, the two can fall far apart, and the simple average sends freight the wrong way. Ignoring volume is the single most common error in a location study.

Which weight should I use: volume, tons, or shipments?

Use whichever load unit best tracks your transport cost, and use the same unit for every market. Tons work well when freight is priced by weight, shipments or pallets when it is priced by count or space, and annual volume when you want the long-run average rather than a single period. What matters is consistency: never mix tons in one row with pallets in another, because the tool trusts the numbers and a mismatch drags the center toward a market that only looks heavy. If your lanes cost different rates per unit of distance, switch to volume times rate so cost, not just quantity, drives the point.

Should I use grid coordinates or latitude and longitude?

Use grid coordinates when you set your own scale, such as a sketch, a regional map with a ruled overlay, or a warehouse floor, and the distance comes back in your grid units. Use latitude and longitude when your markets are real cities spread across a region or country and you want the center returned as a map coordinate. In lat/long mode put longitude in the X column and latitude in the Y column, and pick the geodesic metric so distance is measured along the curve of the earth with the Haversine formula in kilometers or miles. Both give the same weighted-average logic; only the distance measurement differs.

What is the difference between straight-line and road distance?

Straight-line distance is the crow-flight line between two points, and it is what the Euclidean and geodesic metrics measure. Road distance is what a truck actually drives, following highways that bend around rivers, mountains, and city limits, so it is always longer. The gap is captured by a detour factor: multiply the straight-line distance by about 1.2 in open country and up to 1.5 in dense or mountainous terrain to approximate the real haul. The center of gravity barely moves when you apply a uniform factor, since it scales every lane together, but the cost you attach to the layout should reflect the longer road.

What are ton-miles and ton-kilometers?

A ton-mile is one ton of freight moved one mile, and a ton-kilometer is one ton moved one kilometer. They combine weight and distance into a single measure of transport work, which tracks cost far better than distance alone because moving more weight or moving it farther both cost more. The tool reports total weighted distance in these units: the sum over all markets of load times distance to the center. For the default layout that total is 10,757.9 weighted units. Comparing the ton-miles of one candidate site against another is how you rank locations on transport cost.

How many locations do I need to enter?

You need at least two points for the method to mean anything, and it becomes useful from three or more, since a single point is its own center. The tool starts with four editable rows and lets you add more, so you can model a handful of major markets or a longer list of customers. There is no strict upper limit for the math, but the answer is only as good as the loads you enter, so group tiny scattered customers into regional clusters rather than entering hundreds of near-zero rows. A dozen well-chosen markets usually describes a network better than a hundred noisy ones.

What is the difference between the center of gravity and load-distance methods?

The center of gravity computes an ideal point directly from your demand, handing you a coordinate that may not have a road or a building on it. The load-distance method works from a short list of real candidate sites you supply, scoring each by the sum of load times distance and ranking them so you pick the lowest. The two pair naturally: use the center of gravity first to find the zone your volume points to, then gather the genuine sites near it and score those with load-distance. The center of gravity finds the target; load-distance picks the buildable site.

Can it locate more than one facility?

No. The center of gravity places a single facility at one weighted-average point. For a network of several plants or warehouses that share the demand you need a p-median or network optimization model, which assigns each market to its nearest facility and finds the set of locations that minimizes total weighted distance across all of them. Running the center of gravity on the whole demand and hoping to read two sites from one point does not work, because the single centroid ignores how markets split between facilities. Use the right model when the problem has more than one site.

What is the infeasible-point or lake problem?

The center of gravity is a pure transport calculation, so it can land on a place you cannot build: a lake, a mountain, a runway, a protected forest, or land nobody will sell. The math has no idea what sits at the coordinate it returns; it only balances weight and distance. That is why the point is a starting zone, not an address. Draw a circle a few miles or kilometers around it, gather the real sites inside, and score those with load-distance against land price, labor, taxes, and road access. The ideal point guides the search, and a feasible site wins the decision.

Does the center of gravity guarantee the minimum transport cost?

Not exactly. The plain Cx and Cy formula minimizes the sum of weighted squared distances, which is close to but not the same as the point that minimizes weighted distance, the true ton-mile minimum known as the Weber point. To reach that point you refine with Weiszfeld’s algorithm, which re-weights each market by its load divided by its current distance and recomputes the average until it settles. For well-spread points the two are almost identical, as in the default layout where the refinement saves about 0.0 percent. On a lopsided network with one dominant market the refinement can shave a real slice off the ton-miles.

What is the difference between Euclidean and rectilinear distance?

Euclidean distance is the straight line between two points, the square root of the squared coordinate gaps, and it suits open regions where freight is not confined to a grid. Rectilinear distance, also called Manhattan distance, is the sum of the horizontal and vertical gaps, which fits a street grid or a warehouse aisle where travel follows right angles. The two can give different totals for the same layout, and the rectilinear figure is usually larger because it never cuts the corner. Pick the one that matches how your freight actually moves, and for latitude and longitude use the geodesic metric instead of either.

Why should I weight by volume times rate instead of volume alone?

Volume alone assumes every lane costs the same per unit of distance, which is rarely true. A refrigerated, hazardous, or return-haul-short lane costs more per ton-mile than a plain dry van, and in many networks the outbound rate to a market runs well above the inbound rate from a supplier. Weighting by volume times rate lets the expensive lanes pull the center harder than their tonnage alone would, which puts the facility closer to the costly demand. If all your rates are equal the rate column changes nothing, so use it whenever cost per unit distance varies across your markets.

How do I get coordinates for my markets?

For grid mode, overlay a simple ruled grid on a regional map and read the X and Y of each market off the axes, keeping the same scale for every point. For latitude and longitude mode, look up each city in any map service, which gives a latitude and longitude pair you can paste straight into a row with longitude in the X column and latitude in the Y column. Either way, the coordinates only need to be consistent with each other, not tied to any official system, since the method cares about relative positions and the loads at them, not absolute geography.

Related facility planning calculators

More tools are coming to this silo. Return to the Facility Planning hub for the full set.

Sources, disclaimer, and editorial transparency

The weighted-centroid formula, the Weiszfeld refinement, the load-distance comparison, and the limits described here follow recognized operations-management sources, including the LibreTexts Engineering treatment of the centre of gravity method, practitioner logistics references such as OPSdesign and logistics network guides, and limitation notes from supply chain planning sources such as Logility. Distances are computed as straight-line, rectilinear, or great-circle values, and a detour factor is recommended when reading them as road distance. This calculator and guide are built and reviewed by the OpsCalculators team; see our Editorial Policy for how each tool is researched, built, and tested.

Results are accurate estimates for planning and education, not a substitute for a full network study or a site survey. The method models transport cost only and ignores land, labor, taxes, roads, and feasibility, the point can land somewhere you cannot build, and the plain formula is an approximation of the true ton-mile minimum, so validate outputs before a site or capital decision. See our full Disclaimer. OpsCalculators.com is operated by MAFHH INTERNATIONAL LTD. Your inputs are processed in your browser and are never stored; see our Privacy Policy.