The formula nobody explains properly
U equals m g h. That's the Gravitational Potential Energy Formula you'll see in every textbook, and it works fine until your problem stops working. I've been running structural analyses on crane loads for about twelve years, and I still see people plug numbers into that equation when it gives them wildly wrong answers. The issue is usually that g isn't constant, or h isn't measured from the right reference point, or they're applying it to something that has significant vertical displacement where gravity actually changes. Here's what happens in practice. You're modeling a cable system where a load moves from ground level up to about three hundred meters. A student or junior engineer will use U equals m g h with g at nine point eight one meters per second squared and get an answer. It will be off by roughly one percent. That sounds small until you're checking whether a winch motor has enough torque to handle a peak demand, and your safety margin is two percent. Now you're in trouble. I ran into this on a project involving a suspended camera platform for aerial survey work. The platform would rise to about four hundred meters on a cable. We were calculating energy storage in the cable system for a brake regression test, and the standard formula was underestimating the potential energy by about one point four percent. Not catastrophic for rough estimates, but for the braking system sizing it mattered. The workaround was switching to the full gravitational form: U equals negative G M m divided by r, where r is the distance from Earth's center. I calculated the difference between the surface term and the elevated term, and that gave me the actual change in potential energy. The result was about three point two megajoules higher than what U equals m g h produced. Three point two megajoules is the difference between a braking system that works and one that doesn't.
The takeaway is that you should treat U equals m g h as an approximation that's valid when the change in height is less than about five percent of Earth's radius. That works out to roughly three hundred kilometers. Below that, the error stays under one percent. Above that, you need the inverse-square version or you're just guessing.
What the variables actually mean in real work
m is straightforward. It's the mass of the object in kilograms. Don't use weight here. If you have something that weighs five hundred newtons, you divide by g to get the mass first. I've seen this mistake enough times that I still catch myself double-checking units when someone hands me a spec sheet labeled in kilograms-force instead of newtons. g is the local gravitational acceleration. Nine point eight one meters per second squared is the standard value, but it varies by latitude and altitude. At the equator it's closer to nine point, and at the poles it's closer to nine point. If you're working on a project that spans a large range of latitudes, like a pipeline or a long rail line, using a single g value can introduce systematic error. Again, usually small, but systematic errors don't average out. h is the height above a reference point, and this is where most people go wrong. h isn't an absolute elevation. It's the change in vertical position relative to wherever you've decided zero potential energy is. You can set that reference anywhere you want. In most engineering problems it makes sense to set it at the lowest point the object reaches, so all your potential energy values are positive and easy to compare. But in orbital mechanics or cable tension problems, people sometimes forget this and treat h as an absolute altitude from sea level, which works fine if your reference is sea level, but gets confusing fast when multiple objects are involved at different starting elevations.
Get the Full Details

I worked on a hydroelectric intake design once where we had water dropping from a reservoir at two thousand meters elevation down through a penstock to a turbine at eight hundred meters. A contractor on the project used sea level as the reference for the reservoir and the turbine base as the reference for the turbine. The numbers looked reasonable individually but were completely inconsistent when you tried to do an energy balance across the system. It took me twenty minutes to find because nobody flagged the mismatch. Now I always verify that a single reference plane applies to every object in a problem before I start calculating.
The inverse-square formula you should know about
When you need more accuracy or you're dealing with large height changes, the full formula is U equals negative G M m divided by r. G is the gravitational constant, six point times ten to the negative eleventh newton meter squared per kilogram squared. M is Earth's mass, five point seven two times ten to the twenty-third kilograms. m is your object's mass. r is the distance from Earth's center, so you add Earth's radius, about six million three hundred seventy-one kilometers, to whatever altitude you're working at. The negative sign isn't a quirk. It means the potential energy is defined as zero at infinite distance and becomes more negative as objects get closer. The change in potential energy between two heights is what matters physically, and that delta is always positive when you lift something up. For most practical purposes you just calculate U at the top minus U at the bottom and drop the negatives. Using this formula at three hundred meters gives you essentially the same answer as U equals m g h, but at three thousand meters the difference is about one point five percent. At thirty thousand meters, which is where some high-altitude drone platforms operate, the difference jumps to roughly ten percent. If your application involves anything above twenty kilometers, skip the approximation.
Common pitfalls that cost time
The biggest waste I see is people who derive the formula from energy conservation first principles when they already know the answer. Say you have a pendulum or a falling object and you're asked to find velocity at the bottom. Setting m g h equal to one half m v squared and solving for v is direct. Deriving it from Newton's second law with integration takes about five times longer and introduces more chances for algebra mistakes. Use the formula. Save the derivation for when you actually need it. Another issue is neglecting the reference frame. Gravitational potential energy is relative. If you're working in an accelerating elevator or on a rotating platform, you need to account for the non-inertial frame effects separately. The standard formula assumes a stationary reference frame near Earth's surface. I had a client who was calculating the energy requirements for an elevator system and forgot to include the kinetic energy of the counterweight. The potential energy math was correct in isolation but the total system budget was off by about eighteen percent because the counterweight was descending while the car was ascending. Both objects contribute to the energy balance. Don't model just the load and pretend the rest of the system doesn't exist. Unit consistency is the third frequent problem. Mixing grams with meters and seconds, or pounds with newtons, will garbage your result instantly. Always convert to SI units first: kilograms for mass, meters for height, seconds for time. If you're working in imperial units, use slugs for mass or stick to pound-force and foot-second consistently. I've converted about forty percent of incoming calculations from messy mixed units to clean SI and found that roughly half of those had fundamental unit errors that made the original number meaningless.

When to use what
For classroom problems and most everyday engineering, U equals m g h is perfectly adequate. It's fast, it's intuitive, and it's accurate enough for height changes under a few hundred meters. Use it when you're doing quick estimates, teaching concepts, or working on systems where the one percent error bar is acceptable. That covers the vast majority of cases. Use the inverse-square formula when you're dealing with altitude changes above a few kilometers, when you need precision better than one percent, or when you're working in contexts where g varies significantly like mountain terrain or aerospace applications. The extra calculation complexity is minimal with a spreadsheet, and the accuracy gain is real. Don't use either formula in a non-inertial reference frame without adding fictitious force terms. Don't use it for orbital mechanics where the trajectory is parabolic or hyperbolic. Don't use it inside a planet where the gravitational field changes with depth. There are correct formulas for all of those scenarios, but U equals m g h isn't one of them.
The formula itself is simple. The context around it is where the work happens. Getting the reference frame right, choosing the right version of the equation for your altitude range, and keeping your units consistent will save you more headaches than any shortcut through the math.