Height of a square pyramid
A square pyramid with a base side of 6 and a volume of 144 stands 12 tall: enter those two values and get the perpendicular height in the matching unit. Handy for pyramidal roofs, hoppers and stockpiles. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Base side
- 6
- Volume
- 144
- Height
- 12
- Base area
- 36
- Decimal places
- 6
The height of a square pyramid calculator reverses the standard volume formula: given the volume of a square pyramid and the side length of its square base, it returns the perpendicular height from the apex to the base. Instead of rearranging V = (1/3)·s²·h by hand — squaring the side, dividing, multiplying by three on a pocket calculator — you send two numbers and get the height, rounded to the precision you choose. It is useful whenever the capacity of a pyramidal object and its footprint are known but its vertical extent is not: a roof, a monument, a hopper, a pile of sand.
From volume and base side back to a height
The volume of a square pyramid is one third of the volume of the square prism that would contain it: V = (1/3)·s²·h, where s is the side length of the square base and h is the perpendicular height from the apex to the plane of the base. You provide the volume and the base side in any consistent unit system — cubic meters and meters, cubic inches and inches, liters and centimeters — and the result comes back in the matching linear unit.
If you feed it cubic feet and feet, the height is in feet. The response also echoes the base side and the computed base area s², so a downstream pipeline can reuse the intermediate result without recomputing it.
Units, precision and edge cases
The calculator does not convert units, and that is deliberate: mixing systems silently is the most common source of wrong geometry results in automated pipelines, so the input contract keeps you in control. Whatever unit cubed you send as volume must correspond to the unit you send as base side. The optional decimals parameter controls half-up rounding of the result, from 0 to 12 places, with a default of 6.
Internally the computation uses double-precision arithmetic, so the only rounding that happens is the one you explicitly asked for. Magnitudes so extreme that the result would overflow double precision are also rejected rather than returned as Infinity, which keeps downstream consumers safe from silent garbage.
Where it fits in real work
Architects and civil engineers working with pyramidal roofs or monuments often know the design capacity or fill volume and the base footprint, and must derive the ridge height from those two constraints — that is exactly this computation. The same applies in bulk-material handling for estimating how tall a square-based hopper or stockpile must be to hold a given tonnage, in packaging for pyramid-shaped containers, and in education for checking homework against a trusted source.
What you can do with it
Design a pyramidal roof
Given the enclosed volume the attic must have and the square footprint of the building, derive the ridge height the roof needs to reach.
Size a square hopper
From the required storage capacity and the available floor square, compute how tall a square-based hopper must be before ordering fabrication.
Check geometry homework
Verify the height step of a square-pyramid volume exercise against a deterministic reference instead of redoing the algebra by hand.
FAQ
What units does the result have?
The linear unit consistent with your inputs: if the volume is in cubic meters and the base side in meters, the height is in meters.
What happens with a zero or negative input?
Volume and base side must both be positive finite numbers, and rejected requests are not billed.
How precise is the result?
The computation uses double-precision arithmetic; the only rounding is the half-up rounding at the decimals you request, from 0 to 12 places (default 6).
Does it work for rectangular or oblique pyramids?
No. It assumes a right pyramid with a square base.
What formula does it use?
It turns the volume formula around: the height is three times the volume divided by the square of the base side. With a side of 6 and a volume of 144, the base area is 36 and the height comes out at 12.
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/math/height-of-a-square-pyramid \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"base_side":6,"volume":144}'const res = await fetch("https://api.kit.forhosting.com/math/height-of-a-square-pyramid", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"base_side": 6,
"volume": 144
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/height-of-a-square-pyramid",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"base_side": 6,
"volume": 144
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/height-of-a-square-pyramid", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"base_side":6,"volume":144}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"base_side":6,"volume":144}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/height-of-a-square-pyramid", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"base_side": 6,
"volume": 144
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.height_of_a_square_pyramid",
"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
The same code runs free in your browser and behind the paid API, so the number you see on this page is exactly the number your integration receives.
From volume and base side back to a height
Solving that equation for the height gives h = 3V / s². This endpoint performs that rearrangement for you, in a single deterministic step with no iteration and no approximation — no π, no roots, just one squaring, one multiplication and one division.
Units, precision and edge cases
Both values must be positive finite numbers; a zero or negative volume or side has no physical meaning for a pyramid and is rejected with an invalid_input error, which is never billed.
Where it fits in real work
Because the endpoint is a pure function with no state and no network calls, it is safe to call inside loops, batch jobs and CI checks. It runs on our global edge with the same code that runs free in your browser on this page, so you can validate a case by hand here and then automate it via the API for $0.002 per request, with the guarantee that both paths produce identical output.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page.
Which formula does it use?
It solves V = (1/3)·s²·h for the height: h = 3V / s², where s is the base side length.