French drain calculator
A 50 foot French drain trench 1 foot wide and 2 feet deep takes about 3.7037 cubic yards of gravel and 50 feet of pipe. Enter the trench you will actually dig before ordering stone. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Length
- 50
- Width
- 1
- Depth
- 2
- Volume cubic feet
- 100
- Gravel cubic yards
- 3.7037037037
- Pipe length
- 50
A French drain is a gravel-filled trench with a perforated pipe that intercepts groundwater and carries it away from a foundation, lawn, or low spot. Before you order washed stone and SDR pipe, you need two quantities from the trench you will actually dig: cubic yards of gravel to fill the prism, and linear feet of pipe that run the length of that trench. This French drain calculator takes three strictly positive numbers—trench length, width, and depth in feet—and returns gravel in cubic yards as length times width times depth divided by twenty-seven, plus pipe length equal to the trench length.
How gravel cubic yards and pipe length are computed from the trench
A French drain is modelled here as a right rectangular prism: the trench you excavate, later filled with washed drainage stone around a perforated pipe that runs from the high end to a daylight outlet, a dry well, or a storm connection. Volume in cubic feet is length times width times depth when those three lengths share one unit, and this contract uses feet. Cubic yards of gravel are that volume divided by twenty-seven, because one cubic yard contains twenty-seven cubic feet.
A fifty-foot trench one foot wide and two feet deep is one hundred cubic feet, which is one hundred over twenty-seven cubic yards of stone, with fifty feet of pipe. Width and depth are often measured in inches on site; convert before calling by dividing by twelve, so an eighteen-inch depth is one and a half feet and a twelve-inch width is one foot. The calculator does not convert inches, does not subtract the pipe cylinder from the gravel prism, and does not add a waste or compaction factor.
Those are job-specific multipliers applied after the geometric take-off so a quote stays transparent. All three inputs must be strictly positive finite numbers. A zero or negative length cannot be a drain run, a zero width is not a trench, and a non-positive depth is not an excavation.
What you send, which units to use, and how validation fails
Convert inches to feet by dividing by twelve before you call: a twelve-inch width is 1, an eighteen-inch depth is 1.5, a twenty-four-inch depth is 2. Mixing inches of width with feet of length without converting would overstate gravel by a factor of twelve, so the contract keeps one unit set and leaves conversion to the caller. A fifty-foot by one-foot by two-foot trench yields one hundred cubic feet, about 3.7037 cubic yards of gravel, and fifty feet of pipe.
Validation failures name the offending field so a form can highlight length when someone types zero, or depth when a spreadsheet leaked a negative. Upper and lower limits keep intermediate products finite: each field must be at least 1e-15 and at most 1e12.
Where a French drain calculator earns its keep
Landscape contractors and drainage crews estimate washed stone and perforated pipe before they rent a trencher so they can quote a foundation run, a downspout interceptor, or a soggy lawn instead of guessing from a previous job. Homeowners digging beside a wet basement wall, municipal lot desks checking a daylight drain, and estimators comparing a twelve-inch by eighteen-inch trench against a bid tab all want the same three-input contract.
Curriculum authors and quantity-survey trainers can pin goldens: fifty by one by two must stay one hundred cubic feet and one hundred over twenty-seven cubic yards, with pipe length fifty. If you later need gravel weight from bulk density, a paver base in inches of depth, or a pipe-volume cylinder as a first-class form, treat those as separate search intents rather than overloading this French-drain landing.
The tool is a rectangular trench take-off, not a substitute for a soils report, a frost-depth schedule, or a local code that may require a socked pipe, a minimum slope, or a specific stone gradation. Failed validation is not billed, which keeps exploratory scripts cheap when you deliberately send a zero depth to verify error handling.
Round-trip checks are easy: recompute length times width times depth by hand, divide by twenty-seven, and confirm the published cubic feet, cubic yards, and pipe length match within the same twelve-decimal rounding used for all numeric fields.
What you can do with it
Order washed stone and pipe for a foundation run
Contractors enter trench length, width, and depth in feet to size the gravel ticket and the linear feet of perforated pipe before the first load leaves the yard.
Homeowner take-off for a wet yard or downspout interceptor
Convert a planned twelve-by-eighteen-inch trench into cubic yards of drainage stone and pipe length so a big-box order matches the hole you will actually dig.
Classroom prism-to-yards checks on drainage take-offs
Instructors and LMS auto-graders verify that length times width times depth over twenty-seven yields the expected cubic yards for a measured rectangular trench.
FAQ
How do I calculate gravel and pipe for a French drain?
Send positive trench length, width, and depth in feet.
Are the dimensions in inches or feet?
Feet. Convert inches to feet by dividing by 12 before calling: a 12-inch width is 1, an 18-inch depth is 1.5. Mixing inches with feet without converting would overstate the gravel.
What happens if a dimension is zero or negative?
Length, width, and depth must all be positive; a non-positive dimension cannot be a physical trench and is not billed.
Does the calculator subtract the pipe from the gravel volume?
No. Gravel is the full trench prism. Pipe displacement, fabric, sock, and waste are job-specific extras you apply after the geometric take-off.
Does the gravel figure include extra for waste or compaction?
No. It is the plain volume of the trench, so the quote stays easy to follow. Add your own waste or compaction margin afterwards, along with the fittings, cleanouts and outlet the job needs.
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/build/french-drain \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"length":50,"width":1,"depth":2}'const res = await fetch("https://api.kit.forhosting.com/build/french-drain", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"length": 50,
"width": 1,
"depth": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/build/french-drain",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"length": 50,
"width": 1,
"depth": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/build/french-drain", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"length":50,"width":1,"depth":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"length":50,"width":1,"depth":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/build/french-drain", 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": 50,
"width": 1,
"depth": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "build.french_drain",
"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.
Limits
max_dim | 1000000000000 |
min_dim | 1e-15 |
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
Zero or negative dimensions fail with invalid_input and are not billed. Successful API calls use the published base of $0.002 per item.
How gravel cubic yards and pipe length are computed from the trench
Pipe length is the trench length: you buy perforated drain pipe by the linear foot to match the run you dug, then add fittings, cleanouts, and a daylight stub yourself. The identity is the definition of a rectangular prism rearranged for a US landscape ticket: gravel_yd3 equals length times width times depth over twenty-seven, and pipe_length equals length. The same three numbers always produce the same cubic feet, the same cubic yards, and the same pipe length after fixed twelve-decimal rounding, so goldens, widgets, and API clients never disagree on a fifty-by-one-by-two take-off.
What you send, which units to use, and how validation fails
Send three required numeric fields. length is a finite positive number for the trench run in feet; aliases L, l, trench_length, and run are accepted so survey notes do not need a rename. width is a finite positive number for the excavated width in feet; aliases W, w, and trench_width are recognized. depth is a finite positive number for excavated depth in feet; aliases D, d, trench_depth, and height are recognized. Strings that parse as finite numbers are accepted the same as JSON numbers. On success the response echoes the cleaned inputs, publishes volume_cubic_feet as the product of the three lengths, gravel_cubic_yards as that volume divided by twenty-seven, pipe_length as the trench length, and formula as the string gravel_yd3 equals length times width times depth over 27 with pipe_length equal to length. Failed tasks return invalid_input and do not consume prepaid balance. Successful API calls use the published base of $0.002 per item.
Technical questions
What does the French drain calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.