Square pyramid calculator
Enter the base side and height of a square pyramid and get its volume, slant height, lateral area and total surface at once: a side of 4 and a height of 3 give a volume of 16 and a surface of 44.84441. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Side
- 4
- Height
- 3
- Decimal places
- 6
- Slant
- 3.605551
- Volume
- 16
- Lateral area
- 28.84441
- Surface area
- 44.84441
Volume and surface of square pyramid from side and height. Search intent: square pyramid volume. No network calls or random seeds are required. Failed jobs are not billed.
Five measurements from two numbers
A square pyramid is fixed by the side of its base and its vertical height, the distance from the centre of the base straight up to the tip. Everything else follows from those two numbers. The slant height, measured up the middle of each triangular face, comes from the right triangle formed by the height and half the base side. The volume is the side squared times the height, divided by three. The lateral area adds up the four faces, and the total surface adds the base as well. With a side of 4 and a height of 3 you get a slant height of 3.605551, a volume of 16, a lateral area of 28.84441 and a surface area of 44.84441.
The usual mix-ups
The first is taking the slant height for the vertical height. The vertical height runs straight through the inside of the pyramid, while the slant height climbs the middle of a face. Neither one is the edge that runs from a corner to the tip. The second is using the total surface when the base will not be covered, which is exactly when the lateral area is the figure you need. Keep the side and the height in the same unit, and the areas come out in that unit squared and the volume in that unit cubed. Entries are checked before any arithmetic, and if you set the number of decimals the result is rounded only once.
What you can do with it
Teaching
Pinned goldens.
FAQ
How do I find the volume of a square pyramid?
Multiply the base side by itself, multiply by the height and divide by three. A base side of 4 and a height of 3 give a volume of 16, exactly a third of a box with the same base and height.
How is the slant height of a face worked out?
Half the base side, the vertical height and the slant height form a right triangle, so Pythagoras gives the slant height. With a side of 4 and a height of 3 it comes out at 3.605551.
What is the difference between lateral area and surface area?
Lateral area covers only the four triangular faces, while surface area adds the square base. For a side of 4 and a height of 3 that is 28.84441 for the faces and 44.84441 in total.
Can I enter the slant height instead of the vertical height?
Yes. If you measured the slant height of a face rather than the vertical height, enter it with the base side. The calculator works back to the height through the same right triangle and then finishes the rest.
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/square-pyramid \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"side":4,"height":3}'const res = await fetch("https://api.kit.forhosting.com/math/square-pyramid", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"side": 4,
"height": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/square-pyramid",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"side": 4,
"height": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/square-pyramid", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"side":4,"height":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"side":4,"height":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/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
{
"side": 4,
"height": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.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 calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos.
How it works
Volume and surface of square pyramid from side and height. V=a²h/3; face slant related by Pythagoras. No network calls or random seeds are required. Failed jobs are not billed. No network calls or random seeds are required. Failed jobs are not billed. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos.
Inputs, limits and rounding
Optional decimals use half-up once. Outputs echo inputs. No network calls or random seeds are required. Failed jobs are not billed. No network calls or random seeds are required. Failed jobs are not billed. Provide required JSON fields. Invalid types raise invalid_input. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos.
When to use it
Use when search intent matches. Volume and surface of square pyramid from side and height. No network calls or random seeds are required. Failed jobs are not billed. No network calls or random seeds are required. Failed jobs are not billed. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS, automation, or teaching demos.
Integration use cases
Quick check
Free widget.
Automation
Same JSON via API.
Technical questions
Free?
Yes tier A.
Network?
No.
Bad input?
invalid_input.
API?
Yes.
Locales?
EN-only; Nitro hydrates.