Friction factor calculator
With a Reynolds number of 100,000 and a relative roughness of 0.0002, the Darcy friction factor is 0.019003236842, in turbulent flow. One explicit formula covers laminar, transitional and turbulent pipes, so you can skip the Moody chart. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Relative roughness
- 0.0002
- Reynolds
- 100,000
- Friction factor
- 0.0190032368
- Regime
- turbulent
The Darcy friction factor is the dimensionless coefficient that sits in the Darcy-Weisbach head-loss identity for internal pipe flow. Engineers, students, and hydraulic scripts look it up on a Moody chart from two numbers: the pipe Reynolds number and the relative roughness ε/D. This friction factor calculator accepts those two inputs and evaluates Churchill's 1977 explicit correlation, which recovers the laminar Hagen-Poiseuille branch f equals 64 over Re at low Reynolds number and tracks the turbulent Colebrook-White family once the flow is fully turbulent.
What the Darcy friction factor is and when this page applies
The Darcy friction factor, also called the Darcy-Weisbach friction factor, is the dimensionless number f that appears in the head-loss identity hf equals f times L over D times V squared over 2g for incompressible flow in a circular pipe. It is not the Fanning friction factor, which is one quarter of the Darcy value and belongs in a different set of textbooks and process-industry spreadsheets.
For a given Newtonian fluid and a given circular pipe, f is fixed once you know the Reynolds number Re equals rho V D over mu and the relative roughness epsilon over D, where epsilon is the equivalent sand-grain height of the inner wall and D is the internal diameter.
Those two numbers are the axes of the Moody diagram: laminar flow on the left follows f equals 64 over Re with no roughness dependence, a transitional band sits around Reynolds numbers of a few thousand, and the fully turbulent family of curves on the right rises with relative roughness and flattens toward a roughness-only fully rough limit.
Search intent around friction factor calculator, Darcy friction factor from Reynolds number, Moody chart friction factor, and pipe relative roughness clusters on this landing rather than at a Colebrook-only iterative solver, a Reynolds-number constructor, or a Darcy-Weisbach head-loss tool. Zero relative roughness is the hydraulically smooth limit and is accepted; a negative grain height is rejected because a sand-grain height cannot be negative.
How this calculator validates input and evaluates Churchill f
Relative roughness must lie in the closed interval from 0 to 0.05, the commercial range drawn on a standard Moody chart. Reynolds number must be strictly positive: zero or a negative Re is refused with a message that the Darcy friction factor is undefined for a non-positive Reynolds number, matching the contract of this landing.
After validation the engine evaluates Churchill's 1977 explicit correlation: A is 2.457 times the natural log of one over the quantity 7 over Re to the 0.9 plus 0.27 times epsilon over D, all raised to the sixteenth power; B is 37530 over Re to the sixteenth; f is eight times the twelfth root of 8 over Re to the twelfth plus A plus B to the minus three-halves.
That single closed form recovers laminar 64 over Re at low Re and tracks the turbulent Moody curves without a Newton loop. Results are rounded to twelve decimal places so the same pair always serializes the same way across JavaScript engines. There is no network, no random seed, and no wall clock in the computation path.
What you can do with it
Commercial pipe sizing sketches
Designers estimate the Darcy friction factor of a steel, PVC, or concrete line before they compute Darcy-Weisbach head loss or pick a pump curve.
FAQ
Why is a non-positive Reynolds number rejected?
Re = ρVD/μ must be positive for a physical pipe flow.
Is this the Darcy factor or the Fanning factor?
Darcy (also called Darcy-Weisbach). The Fanning friction factor is one quarter of the Darcy value. Head-loss formulas that use f (L/D) V²/(2g) want the Darcy number this tool returns.
Does the calculator work for laminar flow?
Yes. At low Reynolds numbers the result follows the laminar rule, 64 divided by the Reynolds number, where roughness has no effect. The same formula then carries on smoothly into the turbulent curves.
What relative roughness values can I enter?
Any value from 0 to 0.05, the range drawn on a standard Moody chart. Zero means a hydraulically smooth pipe; a negative value is refused because a sand-grain height cannot be negative.
How does the calculator label the flow regime?
It calls the flow laminar below a Reynolds number of 2300, transitional between 2300 and 4000, and turbulent above 4000. Those are the usual textbook thresholds, shown next to the factor.
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/phys/friction-factor \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"relative_roughness":0.0002,"reynolds":100000}'const res = await fetch("https://api.kit.forhosting.com/phys/friction-factor", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"relative_roughness": 0.0002,
"reynolds": 100000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/friction-factor",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"relative_roughness": 0.0002,
"reynolds": 100000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/friction-factor", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"relative_roughness":0.0002,"reynolds":100000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"relative_roughness":0.0002,"reynolds":100000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/friction-factor", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"relative_roughness": 0.0002,
"reynolds": 100000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.friction_factor",
"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
A non-positive Reynolds number is rejected with invalid_input rather than returning a nonsense factor. Successful API calls are billed at the published $0.002; failed validation is not charged.
What the Darcy friction factor is and when this page applies
People who already have Re and epsilon over D want the Moody-chart number as structured JSON. A non-positive Reynolds number cannot describe a physical pipe flow and is rejected with invalid_input instead of a fabricated factor.
How this calculator validates input and evaluates Churchill f
Send a JSON body with the two required fields relative_roughness and reynolds. Every field must be a finite number or a numeric string that parses to one, including scientific notation such as 1e5; missing fields, empty strings, non-numeric text, NaN, and Infinity fail immediately with invalid_input naming the problem field, and those failures are not billed. Optional aliases such as rr, roughness, epsilon_d, e_d, re, and reynolds_number are accepted when documented so forms and scripts can use textbook symbols. On success the JSON reports friction_factor, the echoed inputs, the formula string, method churchill_1977, and regime laminar, transitional, or turbulent from the usual 2300 and 4000 thresholds.
Practical use, nearby tools, and what this page will not invent
Use the browser tool when you want an immediate Darcy f while grading a fluids homework set, checking a water or oil line sketched as a commercial steel pipe, or teaching why the Moody diagram has a laminar branch, a transitional smear, and a turbulent family. Identical inputs always produce the same friction factor, method label, and regime, which makes the capability safe to pin in continuous-integration checks and reproducible course materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. Stay inside the published bounds so intermediate logarithms and high powers remain defined on a Worker isolate. This page is not the Reynolds-number calculator, which builds Re from density, speed, length, and viscosity — compute Re first, then come here. It is also not a Darcy-Weisbach head-loss tool and not a Fanning-factor converter. For an iterative Colebrook-White residual on the turbulent branch only, the dedicated Colebrook landing refuses Re below 4000 on purpose; this friction-factor page instead uses Churchill so a single endpoint can return a Moody-consistent f for any positive Reynolds number, including the laminar 64 over Re limit.
Integration use cases
Homework and Moody-chart checks
Students and graders compute Darcy f from a known ε/D and Re, including the laminar 64/Re limit, and get a clear invalid_input error when the Reynolds number is non-positive.
Deterministic fixtures for hydraulics tests
Pipelines that seed unit tests or interactive Moody demos call a pure Churchill oracle instead of reimplementing high powers and logarithms in every language.
Technical questions
How do I compute the Darcy friction factor from Reynolds number and relative roughness?
POST a non-negative relative roughness ε/D (at most 0.05) and a positive Reynolds number. The API evaluates Churchill (1977) and returns friction_factor plus the flow regime.
What inputs does the friction factor calculator need?
Two finite numbers: relative_roughness (ε/D, including 0 for a smooth pipe) and reynolds (Re > 0). Aliases such as rr, epsilon_d, e_d, re, and reynolds_number are accepted.
What does the friction factor calculator cost?
The in-browser runner is free and uses the same library as the API. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.