Right rectangular pyramid
A pyramid with a 6 by 4 base and a height of 3 holds 24 cubic units and has a total surface of 62.603870401261. Enter the base and height to get the volume, the surface of all five faces and both face slants. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Length
- 6
- Width
- 4
- Height
- 3
- Base area
- 24
- Volume
- 24
- Slant height length
- 3.6055512755
- Slant height width
- 4.2426406871
A right rectangular pyramid has a rectangular base and an apex that sits directly above the center of that base, so the height is perpendicular to the base plane. Given the base length, the base width, and that perpendicular height, this calculator returns the enclosed volume and the total surface area — the rectangular base plus the four triangular lateral faces — together with the two mid-edge face slants used to build those triangles.
How volume and surface area are computed
Label the rectangular base edges as length l and width w, and the perpendicular distance from the apex to the base plane as height h. The apex of a right rectangular pyramid lies on the axis through the center of the base, so that height is orthogonal to the rectangle and does not lean toward any side. Base area is simply the product of l and w.
Pyramid volume is one-third of base area times height, which is V equals one-third times l times w times h for every right rectangular pyramid, square or not. Surface area needs the four lateral faces. Those faces come in two congruent pairs of isosceles triangles.
Total surface area is the rectangular base plus that lateral surface. A classic check is length six, width four and height three: volume is twenty-four cubic units, the two slants are the square root of thirteen and three times the square root of two, and the total surface is twenty-four plus six times the square root of thirteen plus twelve times the square root of two. Because the path uses only multiplication, division and square roots of sums of squares, it is deterministic, constant time, and free of iterative solvers.
What you send and what you get back
Provide three required finite numbers: length is one edge of the rectangular base and must be strictly positive; width is the other base edge and must be strictly positive; height is the perpendicular apex-to-base distance and must also be strictly positive. There is no optional slant, lateral edge, apex offset or unit conversion — this landing is the right rectangular pyramid from length, width and height only.
A square base is allowed as the special case where length equals width; it is still a right rectangular pyramid and the two face slants become equal. Example checks: length six, width four and height three recover the textbook radicals above; length five, width five and height twelve recover the familiar square-pyramid numbers, including volume one hundred and a single repeated slant. Wire the free browser tool for quick sanity checks, then call the identical contract from scripts for bulk evaluation without reimplementing pyramid formulas in every language.
Where right rectangular pyramid calculations show up in real work
Secondary-school and college solid-geometry courses constantly ask students for the volume and surface area of a right rectangular pyramid given the two base edges and the height; a trusted calculator with a strict positive-input gate speeds homework grading and removes spreadsheet mistakes where someone uses a prism formula, forgets the one-third, or applies the square-pyramid slant to a non-square rectangle.
Architecture, roofing and fabrication workflows size rectangular tent peaks, pavilion roofs, monument caps, hoppers and decorative planters from plan length, plan width and cut height; volume feeds fill and concrete estimates while total surface area feeds cladding, paint and sheet-metal takeoffs before the four triangles are detailed. Packaging, display stands and product design often use right rectangular pyramids for point-of-sale geometry and tapered lids; deterministic metrics support quotes without a full mesh library.
Game, graphics and CAD libraries store rectangular pyramid primitives for collision proxies and lighting volumes; echoing method plus the three inputs makes debug property panels self-describing. If you later need a square pyramid only, a generic pyramid from base area, a hexagonal pyramid, a frustum, or a rectangular prism, treat those as separate search intents rather than overloading this right-rectangular-pyramid landing.
What you can do with it
Homework and exam checks
Compute right rectangular pyramid volume and surface area from length, width and height, and reject non-positive dimensions with a clear error.
Roofs, hoppers and fabrication
From plan length, plan width and apex height, recover fill volume and cladding area for rectangular peaks, lids and monument caps.
CAD and game pyramid metrics
Turn base length, width and height into stable volume and surface figures for layout, material estimates and property panels.
FAQ
What formulas does this calculator use?
Volume = (1/3)·l·w·h. Face slants are √(h²+(w/2)²) on the length edges and √(h²+(l/2)²) on the width edges. Total surface = base + lateral.
What happens if length, width or height is zero or negative?
All three values must be strictly greater than zero; the error message names the field (length, width or height).
Is the apex assumed to be centered above the base?
Yes. This is a right rectangular pyramid: the base is a rectangle and the apex lies on the perpendicular through the center of that base.
What does it cost?
The browser tool is free and runs locally.
Does it work for a square pyramid?
Yes. A square base is simply the case where length and width are equal, and the two face slants then come out the same. A base of 5 by 5 with a height of 12 gives a volume of 100.
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/right-rectangular-pyramid \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"length":6,"width":4,"height":3}'const res = await fetch("https://api.kit.forhosting.com/math/right-rectangular-pyramid", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"length": 6,
"width": 4,
"height": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/right-rectangular-pyramid",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"length": 6,
"width": 4,
"height": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/right-rectangular-pyramid", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"length":6,"width":4,"height":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"length":6,"width":4,"height":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/right-rectangular-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
{
"length": 6,
"width": 4,
"height": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.right_rectangular_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
Any non-positive length, width or height is rejected with a clear invalid_input error instead of a silent nonsense volume. No network calls, no random sampling, and no floating-point surprises beyond ordinary IEEE-754 arithmetic on the numbers you provide.
How volume and surface area are computed
The altitude of each triangle that sits on a length edge is the hypotenuse of a right triangle whose legs are h and half the opposite base edge, so slant_height_length equals the square root of h squared plus w over two squared. The altitude of each triangle that sits on a width edge is slant_height_width equals the square root of h squared plus l over two squared. Lateral surface area is then l times slant_height_length plus w times slant_height_width, because each pair contributes one-half base times altitude twice. Huge magnitudes can still overflow IEEE-754 double range; when any result is non-finite the request fails with a clear overflow message instead of returning Infinity in JSON. That closed form matches solid-geometry textbooks and keeps automated graders aligned with hand computation on the same inputs.
What you send and what you get back
Zero, negative, missing, empty, non-numeric, NaN and Infinity values are rejected with invalid_input and are not charged. On success the JSON response returns length, width, height, base_area, volume, slant_height_length, slant_height_width, lateral_surface_area, surface_area and method set to right_rectangular_pyramid_volume_surface so logs and teaching UIs can document the algorithm. API pricing is the published base of $0.002 per successful item.
Where right rectangular pyramid calculations show up in real work
Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.
Technical questions
Does surface_area include the base?
Yes. surface_area is the total surface area (rectangular base plus four lateral triangular faces). lateral_surface_area is the four triangles alone if you need only the sides.