Atmospheric scale height calculator
Air at 288.15 K with a mean molar mass of 0.0289644 kg/mol under 9.80665 m/s² of gravity has a scale height of a little over eight kilometres, shown in metres and kilometres. It works for other planets too. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Temperature k
- 288.15
- Mean molar mass kg per mol
- 0.0289644
- Gravity m per s2
- 9.80665
- Scale height m
- 8,434.6603106637
- Scale height km
- 8.4346603107
- Gas constant j per mol k
- 8.3144626182
Atmospheric scale height is the vertical distance over which pressure falls by a factor of e in an idealized isothermal atmosphere. This calculator evaluates that distance from absolute temperature, mean molar mass, and local gravitational acceleration. It returns the result in meters and kilometers and states the gas constant used, making the calculation easy to inspect, reproduce, and place into a larger atmospheric model. It is useful for Earth conditions as well as comparative planetary calculations when suitable local inputs are available.
What atmospheric scale height represents
Scale height provides a compact description of how rapidly pressure decreases with altitude. In an isothermal atmosphere that obeys the ideal gas law and has constant gravity and composition, pressure follows an exponential profile: pressure at height z is the reference pressure multiplied by exp(-z/H). After one scale height, pressure is about one factor of e below its starting value; after several scale heights, it is successively smaller by the same exponential rule.
The value is not the physical top of an atmosphere, and it does not say that every atmospheric property ends at that altitude. Instead, it is a characteristic length that makes pressure profiles, density profiles, retrieval calculations, and comparisons between planetary atmospheres easier to discuss. A larger scale height means pressure declines more gradually with altitude.
Warmer gases have larger scale heights because their molecular motion is stronger, while heavier molecules and stronger gravity make the atmosphere more vertically compact. This calculator reports the idealized e-folding distance directly, without introducing a reference pressure or altitude that the formula does not require.
How to enter temperature, molar mass, and gravity
Enter temperature as an absolute value in kelvins, mean molar mass in kilograms per mole, and gravitational acceleration in meters per second squared. Unit consistency is essential because the universal gas constant is expressed in joules per mole-kelvin. For a dry terrestrial atmosphere near sea level, a representative mean molar mass is roughly 0.029 kilograms per mole, but the appropriate value changes with humidity, altitude, chemistry, and the world being studied.
Likewise, gravity should describe the location and approximation used by the model rather than being copied automatically from a terrestrial standard. The calculation uses H = R T divided by M g, where R is the universal gas constant, T is absolute temperature, M is mean molar mass, and g is gravitational acceleration. All three supplied quantities must be finite and strictly positive.
In particular, zero molar mass or zero gravity would make the denominator zero, so those inputs return a typed input error instead of an infinite or misleading result. Negative values are also rejected because they are outside the physical domain of this calculation.
Interpret the result and understand the approximation
Use the returned scale height as a local or simplified characteristic distance, not as a complete forecast of a real vertical atmosphere. The derivation assumes constant temperature, composition, and gravity over the altitude interval. Real atmospheres develop temperature layers, molecular composition can change with height, water vapor varies, and gravity decreases with distance from a planet.
Consequently, one scale-height value may summarize a limited region well while becoming inaccurate across a very deep column. For a layered calculation, evaluate the formula separately with representative conditions for each layer or use a hydrostatic integration with profiles that vary continuously. The result can still serve as a valuable reasonableness check: increasing temperature should increase H proportionally, while doubling either mean molar mass or gravity should halve H.
Results are supplied in both meters and kilometers to avoid manual conversion, and the gas constant is included for auditability. No measurements are fetched, so the quality of the answer depends on the physical suitability and units of the values supplied.
What you can do with it
Estimate a terrestrial pressure e-folding distance
Use representative atmospheric temperature, air molar mass, and local gravity to obtain a quick idealized vertical length scale.
Compare planetary atmospheres
Evaluate how different temperatures, atmospheric compositions, or surface gravities change the characteristic pressure decline.
Check an atmospheric model
Compare a model's local pressure behavior with the analytic isothermal scale height as a transparent reasonableness test.
FAQ
What formula does the calculator use?
It uses H = R T / (M g), with absolute temperature T, mean molar mass M, gravitational acceleration g, and the universal gas constant R.
Why must molar mass be entered in kilograms per mole?
The gas constant used by the calculation is in joules per mole-kelvin, so kilograms per mole keeps the SI units consistent and produces meters.
Does scale height mark the top of the atmosphere?
No. It is an e-folding distance for an exponential pressure model, not a sharp atmospheric boundary. Pressure remains nonzero beyond one scale height.
Why do warmer atmospheres have larger scale heights?
Warmer gas molecules move more vigorously, so pressure falls off more gradually with altitude. Heavier molecules and stronger gravity do the opposite and pack the atmosphere into a more compact layer.
Can I use this for another planet?
Yes, as long as you enter that world's absolute temperature, the mean molar mass of its atmosphere and its local gravity. Do not copy Earth's standard gravity or air composition into a calculation for a different planet.
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/earth/scale-height \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"temperature_k":288.15,"mean_molar_mass_kg_per_mol":0.0289644,"gravity_m_per_s2":9.80665}'const res = await fetch("https://api.kit.forhosting.com/earth/scale-height", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"temperature_k": 288.15,
"mean_molar_mass_kg_per_mol": 0.0289644,
"gravity_m_per_s2": 9.80665
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/earth/scale-height",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"temperature_k": 288.15,
"mean_molar_mass_kg_per_mol": 0.0289644,
"gravity_m_per_s2": 9.80665
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/earth/scale-height", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"temperature_k":288.15,"mean_molar_mass_kg_per_mol":0.0289644,"gravity_m_per_s2":9.80665}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"temperature_k":288.15,"mean_molar_mass_kg_per_mol":0.0289644,"gravity_m_per_s2":9.80665}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/earth/scale-height", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"temperature_k": 288.15,
"mean_molar_mass_kg_per_mol": 0.0289644,
"gravity_m_per_s2": 9.80665
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "earth.scale_height",
"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
Interpret the result and understand the approximation
Browser calculations are free, while an API request uses the displayed base price of $0.002.
Technical questions
What happens when gravity or molar mass is zero?
The request returns an invalid_input error because either zero value makes the formula divide by zero and no finite scale height can be reported.
How much does the calculation cost?
It runs free in the browser. Each API request uses the displayed base price of $0.002.