Vertical spring stretch calculator
A 2 kg mass hanging from a 100 N/m spring under 9.8 m/s² gravity stretches it by 0.196 m. Enter mass, spring constant and gravity to get the static sag and the weight. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass
- 2
- Spring constant
- 100
- G
- 9.8
- Weight
- 19.6 m
- Stretch
- 0.196
- Equation
- δ = (2 × 9.8) / 100 = 0.196 m
A vertical spring stretch calculator answers a classic statics question in one step: how far does an ideal spring extend when a mass hangs at rest from its free end? At equilibrium the upward spring force k times delta balances the weight mg, so the static stretch is simply mass times gravity over the spring constant. Students checking homework, lab teams sizing suspension springs, and engineers estimating static sag all need that length in metres without reopening a textbook.
What δ = mg/k means and which quantities you need
When a mass m hangs from a vertical ideal spring of stiffness k under constant gravity g, static equilibrium requires that the spring force equal the weight. With the usual Hooke form F equals k delta directed upward and weight mg downward, the balance is k delta equals m g, which rearranges immediately to delta equals m g over k. With mass in kilograms, g in metres per second squared, and k in newtons per metre, stretch comes out in metres—the length of static sag below the unstretched free length.
Search intent clusters around vertical spring stretch calculator, hanging mass spring extension, static spring deflection mg over k, and equilibrium spring sag. People want a numeric answer they can compare to a diagram or a measured ruler reading, not only a reminder that Hooke's law exists. This tool always solves for stretch from mass, k, and g; it does not rearrange multi-spring networks, does not compute oscillation period, and does not integrate nonlinear force curves.
If your source problem already gives weight as a force rather than a mass, convert to mass with m equals F over g or use an equivalent mass so the mg over k form still applies. Keep units coherent end to end: mixing centimetres for stretch expectations with newtons per metre for k without converting will produce a number that is dimensionally wrong even if the arithmetic is perfect.
Practical use, limits, pricing, and delivery channels
Use the browser tool when you want an immediate static-stretch check while grading homework, verifying a lab spring series against measured hang, or estimating how far a design load will sag a chosen coil. Choose units consistently—if mass is in kilograms and k is in newtons per metre with g in metres per second squared, stretch is in metres; scale all inputs together if you prefer another coherent system and interpret stretch accordingly.
Results are fully deterministic: the same mass, spring constant, and g always yield the same stretch, weight, and equation string. There is no language model, no external physics service, and no randomness, so the capacity is safe to pin in continuous-integration checks and reproducible lesson materials. Prefer this landing when the search intent is specifically vertical hanging-mass stretch rather than general Hooke's law F equals k x, spring constant from force and extension, or spring potential energy—those problems share related arithmetic but different titles and different default inputs.
What you can do with it
Homework and lab hanging-mass drills
Students and graders confirm static spring extension δ = mg/k for given mass and stiffness, with clear rejection when the spring constant is zero.
Design and game-physics static sag checks
Quick structured metres of sag for a hanging load on a known k without standing up a full dynamics or FEA stack.
FAQ
How do I compute vertical spring stretch for a hanging mass?
Optionally set g; default gravity is 9.80665 m/s². The response includes stretch equal to m·g/k in metres.
What happens if the spring constant is zero?
Static stretch δ = mg/k is undefined when k is zero because that would be division by zero.
What units should I use?
Use any coherent set. With mass in kilograms, g in m/s², and k in N/m, stretch is in metres. The calculator does not convert units.
Can I change the value of g?
Yes. Pass g (or gravity) as a positive finite number. If you omit it, standard gravity 9.80665 m/s² is used.
Is the vertical spring stretch calculator free?
The browser tool runs free on your device.
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/vertical-spring-stretch \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass":2,"spring_constant":100}'const res = await fetch("https://api.kit.forhosting.com/mech/vertical-spring-stretch", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass": 2,
"spring_constant": 100
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/vertical-spring-stretch",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass": 2,
"spring_constant": 100
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/vertical-spring-stretch", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass":2,"spring_constant":100}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass":2,"spring_constant":100}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/vertical-spring-stretch", 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,
"spring_constant": 100
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.vertical_spring_stretch",
"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.
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
This capacity accepts hanging mass, spring constant, and optional gravity as finite numbers, rejects a zero spring constant with a clear invalid_input error, and returns stretch, weight, formula, and a substituted equation as structured JSON.
What δ = mg/k means and which quantities you need
That single number appears in introductory mechanics problem sets, lab worksheets that hang known masses from a spring scale, and first-pass design checks for coil springs that must support a payload without bottoming out.
How this calculator validates input and applies δ = mg/k
When g is omitted the solver uses standard gravity nine point eight zero six six five metres per second squared so classroom and SI homework match a shared default. Missing fields, empty strings, non-numeric text, NaN, and Infinity all fail immediately with messages that name the field. Numeric strings that parse as finite decimals are accepted so forms and CSV-style pipelines can pass values without an extra cast. There is no damper, no multi-spring series or parallel combiner, and no unit conversion service—this is ideal one-dimensional static stretch from the three scalars that define the hanging-mass problem. Send a JSON body with required finite fields mass (aliases m and M) and spring_constant (aliases k, K, and stiffness), plus optional g (aliases gravity and gravity_ms2). Mass must be non-negative; gravity must be strictly positive when provided; spring constant must be a finite non-zero number because delta equals m g over k is undefined when k is zero—division by zero is rejected with invalid_input before any result is returned, and failed validation is not charged. Absolute magnitudes are capped so IEEE double arithmetic stays finite on the Worker and in the browser. After validation the weight is formed as mass times g and the stretch as weight divided by spring constant; both are rounded to a stable twelve-decimal grid so the same input always yields the same JSON across JavaScript engines. The response echoes cleaned mass, spring_constant, and g, sets weight to mg, stretch to delta in metres, unit to the string m, formula to the canonical delta equals m g over k line, equation to a fully substituted human-readable quotient, and method to vertical_spring_stretch.
Practical use, limits, pricing, and delivery channels
Each successful request is one billable item at $0.002; failed validation does not consume balance. Pair classroom examples deliberately: two kilograms on a one-hundred-newton-per-metre spring under g equals nine point eight yields zero point one nine six metres of stretch; a deliberately zero spring constant demonstrates the hard invalid_input path. Wire the endpoint into mechanics drills, contest answer checkers, spring-lab worksheets, or preprocessing steps where you already prefer explicit domain errors—such as rejecting zero stiffness—over opaque black-box widgets that cannot explain why a bad input was refused.
Integration use cases
Deterministic fixtures for physics tests
Pipelines that seed unit tests or interactive spring demos can call a pure stretch oracle instead of reimplementing equilibrium arithmetic in every language.