Change in potential energy calculator
Lifting 2 kg by 5 m with gravity at 9.8 m/s² stores 98 J of potential energy: enter the mass, gravity and height change to get the gain, or a negative value when the object goes down. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass
- 2
- Height change
- 5
- G
- 9.8
- Delta pe
- 98 J
- Precision
- 10
This change in potential energy calculator finds how much gravitational potential energy an object gains or loses when its height changes under a near-constant gravitational field. You supply the mass, the local gravitational acceleration, and the height difference Δh between the final and initial positions; the engine evaluates the closed form ΔPE equals m times g times Δh and reports the result in joules when you use SI units. A positive height change means the object rises and stores more potential energy; a negative height change means it falls and loses potential energy by the same magnitude. Zero mass or zero height change is valid and yields zero ΔPE; negative mass is rejected because it has no physical meaning in this model. Unlike a single-height PE tool that answers PE equals m g h at one level, this page answers the energy difference that appears in work–energy problems, conservation checks, and lift or drop scenarios. The engine is fully deterministic arithmetic: no network calls, no sampling, and no date-dependent shortcuts.
What a potential energy change means
In Newtonian mechanics near a planet or moon, when gravitational acceleration is treated as constant over the region of interest, the gravitational potential energy of a point mass is PE equals m times g times h relative to a chosen reference height. The change when the object moves from one height to another is therefore the difference of those values, which simplifies to ΔPE equals m times g times Δh, where Δh is the final height minus the initial height along the vertical.
Mass is the intrinsic property of the object, g is the local gravitational acceleration, and Δh is the signed vertical displacement—not an absolute elevation unless your problem chooses to frame it that way. Because only the difference of heights appears, the arbitrary zero of PE cancels out, which is exactly why energy-conservation problems ask for ΔPE rather than absolute PE.
Along a chosen vertical axis a positive Δh with positive g and positive mass produces a positive ΔPE in the usual SI convention (energy stored by lifting); a negative Δh yields a negative signed change (energy released on the way down). Zero mass or zero height change is valid and yields zero ΔPE when the other factors are finite.
Where change in potential energy fits in study, design, and software
Students meet ΔPE equals m g Δh when a textbook introduces the work–energy theorem, when a conservation problem asks how much potential energy converts to kinetic energy after a drop of height |Δh|, or when a contest problem gives mass, a planetary g, and a lift height and asks for the energy that must be supplied. Teachers can pre-generate answer keys for modest mass, g, and Δh values without trusting opaque calculator apps that silently switch units or confuse absolute PE with energy change.
Developers call the same contract from scripts to seed deterministic test vectors for game physics demos, to normalize user-entered height differences before an energy diagram, or to satisfy programming-challenge statements that demand joules rather than a hand-waved sketch. Structural and product first-order checks use ΔPE equals m g Δh when only mass, local g, and a required lift or drop are known before safety factors or multi-axis dynamics are modeled.
What you can do with it
Homework and energy-balance checks
Compute ΔPE = m·g·Δh from mass, g, and height difference before grading worksheets or comparing mechanical energy balances.
Tutoring and teaching software
Normalize user-entered mass, gravity, and height change into ΔPE for interactive lessons and step helpers.
FAQ
What does the change in potential energy calculator cost?
It is free in your browser on this page.
What formula is used for change in gravitational potential energy?
The change is ΔPE = m · g · Δh, where m is mass, g is gravitational acceleration, and Δh is the height difference (final minus initial). With SI inputs (kg, m/s², m) the unit is joules (J).
What happens if mass is negative?
Negative mass is not accepted because ΔPE = m·g·Δh has no standard meaning for negative mass in this calculator.
How is this different from a gravitational PE = m·g·h calculator?
Absolute PE uses a single height relative to a reference. This tool uses the height difference Δh and returns the energy change ΔPE = m·g·Δh, which is what work–energy and conservation problems usually need.
Why is my result negative?
A negative result means the object ended lower than it started, so it lost potential energy on the way down. Enter a negative height change for a drop; the size of the loss matches the gain for the same rise.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/mech/gravitational-pe-change \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass":2,"height_change":5,"g":9.8}'const res = await fetch("https://api.kit.forhosting.com/mech/gravitational-pe-change", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass": 2,
"height_change": 5,
"g": 9.8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/gravitational-pe-change",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass": 2,
"height_change": 5,
"g": 9.8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/gravitational-pe-change", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass":2,"height_change":5,"g":9.8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass":2,"height_change":5,"g":9.8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/gravitational-pe-change", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mass": 2,
"height_change": 5,
"g": 9.8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.gravitational_pe_change",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs_mass | 1000000000000000 |
max_abs_g | 1000000 |
max_abs_height_change | 1000000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What change in gravitational potential energy means and what the response contains
This calculator returns the normalized inputs mass, height_change, and g, the computed delta_pe, the precision used, a method tag gravitational_pe_change, a short formula reminder, and a unit hint J for SI inputs. There is no numerical integration of a gravity field, no inverse-square orbital potential, and no Monte Carlo sampling: the engine either evaluates the product inside the supported numeric range or rejects the input with invalid_input. Rejected cases include a missing mass, height_change, or g, non-finite values, magnitudes above the documented ceilings, and any mass that is negative, because negative mass is not accepted in this calculator.
How mass, height change, and g are read and how ΔPE stays reproducible
Zero mass is allowed and returns zero ΔPE. Height change may be positive, zero, or negative; negative values mean the object ends lower than it started and produce a negative ΔPE, which is intentional for drop and descent problems. Use approximately 9.80665 for standard Earth gravity, about 1.62 for the Moon, or a measured local value from a lab; the tool does not hard-code a planet and does not convert unit systems for you. Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces and non-numeric tokens are rejected. The preferred field for mass is mass, but aliases m and M are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Mass must be finite and non-negative: a negative value fails with invalid_input and a message that names the field and explains that ΔPE equals m times g times Δh is undefined for negative mass in this calculator, so a bad cell does not become a silent nonsense result. The preferred field for the height difference is height_change, with aliases delta_h, dh, delta_height, height_diff, and h_change. The preferred field for gravitational acceleration is g, with aliases gravity, gravity_accel, gravitational_acceleration, and accel_g. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for the numeric outputs, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the change-in-potential-energy formula yourself.
Where change in potential energy fits in study, design, and software
Product and education tools use the endpoint when a learner types mass, gravity, and height change and the UI must show joules gained or lost. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with absolute potential-energy or free-fall helpers when you need related mechanics, and with other math endpoints when you are building a small lab of free, deterministic physics calculators.
Integration use cases
Deterministic test fixtures
Generate reproducible ΔPE values for unit tests, game-physics demos, and CI assertions on change in potential energy.
Technical questions
Can height_change be negative?
Yes. A negative height change means the object ends lower than it started and yields a negative ΔPE (loss of potential energy). Zero Δh yields zero ΔPE for any finite mass and g.