ForHosting KIT · Engineering & construction

Colebrook friction factor calculator

For a relative roughness of 0.0002 at a Reynolds number of 100000, the Colebrook equation gives a Darcy friction factor of 0.019005435222 after 4 iterations. You get the exact value instead of a Moody chart reading. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Relative roughness
0.0002
Reynolds
100,000
You get
Friction factor
0.0190054352
Inv sqrt f
7.2537250593
Residual
0
Iterations
4

The Colebrook-White equation is the implicit standard that relates the turbulent Darcy friction factor of a circular pipe to relative roughness and Reynolds number. Designers, students, and hydraulic scripts reach for it whenever a Moody-chart lookup would be too coarse or too slow to automate. This Colebrook friction factor calculator accepts a non-negative relative roughness ε/D and a turbulent Reynolds number, starts from a Haaland explicit guess, and iterates Newton-Raphson on the classic 1 over square-root-of-f identity until the residual is numerically zero.

What the Colebrook-White equation is and when Darcy f applies

Colebrook and White published the implicit log identity that still sits under every modern Moody diagram for fully turbulent flow in a circular pipe. In the textbook constants used here, one over the square root of the Darcy friction factor equals minus two times the common logarithm of relative roughness over 3.7 plus 2.51 over Reynolds number times the square root of f. Relative roughness is the equivalent sand-grain height ε divided by the internal diameter D; Reynolds number is the usual ρVD/μ based on that same diameter.

The equation is implicit in f, so there is no algebraic rearrangement that isolates the friction factor with only elementary operations — that is why this calculator iterates instead of evaluating a single closed form. Search intent clusters around colebrook friction factor calculator, colebrook-white equation solver, darcy weisbach f from roughness and reynolds, and turbulent pipe friction factor. Zero relative roughness is the smooth-pipe Prandtl limit and is accepted; negative roughness is rejected because a grain height cannot be negative.

The formula assumes incompressible Newtonian pipe flow, a circular cross-section, and the fully turbulent branch Re greater than or equal to 4000. It does not replace a Moody plot for teaching the qualitative shape of the curves, and it does not convert millimetres of commercial steel into ε/D for you.

Commercial pipe sizing sketches

Designers estimate the Colebrook friction factor of a steel, PVC, or concrete line before they compute Darcy-Weisbach head loss or pick a pump curve.

Why is a Reynolds number below 4000 rejected?

Colebrook-White is the turbulent branch of the Moody diagram.

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.

Why does the Colebrook equation need iteration?

Because the friction factor appears on both sides and cannot be isolated with ordinary algebra. The calculator starts from the Haaland estimate and refines it with Newton's method until the remaining error is zero.

What relative roughness values are accepted?

Any value from 0 to 0.05, the range drawn on a standard Moody chart. Zero is the smooth-pipe limit, and a negative value is rejected because a roughness height cannot be negative.

Can I enter pipe roughness in millimetres?

Not directly. Divide the roughness height by the internal diameter, both in the same unit, to get relative roughness. Work out the Reynolds number beforehand as well, since this page only solves for the friction factor.

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.

POSThttps://api.kit.forhosting.com/eng/friction-colebrook

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.

curl -X POST https://api.kit.forhosting.com/eng/friction-colebrook \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"relative_roughness":0.0002,"reynolds":100000}'
{
  "relative_roughness": 0.0002,
  "reynolds": 100000
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "eng.friction_colebrook",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Laminar or transitional Reynolds numbers below 4000 are rejected with invalid_input rather than returning a laminar 64/Re that this landing does not advertise. Successful API calls are billed at the published $0.002; failed validation is not charged.

What the Colebrook-White equation is and when Darcy f applies

People who already have ε/D and Re want the Moody-chart number as structured JSON, not a head-loss, not a Fanning coefficient (one quarter of Darcy f), and not a Reynolds-number constructor.

How this calculator validates input and iterates to f

Relative roughness must lie in the closed interval from 0 to 0.05, the commercial range drawn on a standard Moody chart. After validation the engine seeds x equals 1 over square root of f with Haaland's explicit approximation, then applies Newton-Raphson to the residual F of x equals x plus 2 log10 of ε/D over 3.7 plus 2.51 x over Re until the step falls below a tight numerical tolerance. 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. 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. Reynolds number must be at least 4000 so the request stays on the turbulent Colebrook branch; values below that threshold are refused rather than silently switched to the laminar closed form 64 over Re, which is a different identity and a different search. 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, inv_sqrt_f, the final residual, the iteration count, the formula string, method colebrook_white_newton, and regime turbulent.

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 Colebrook identity must be solved iteratively. Identical inputs always produce the same friction factor, residual, and method labels, 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 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 laminar tubes with Re well below 2300, use the Hagen-Poiseuille identity f equals 64 over Re in your own notes; this endpoint will refuse that range on purpose so a turbulent landing never pretends to be a laminar one.

Homework and Moody-chart checks

Students and graders compute turbulent Darcy f from a known ε/D and Re, and get a clear invalid_input error when the Reynolds number is still laminar.

Deterministic fixtures for hydraulics tests

Pipelines that seed unit tests or interactive Moody demos call a pure Colebrook oracle instead of reimplementing Newton-Raphson in every language.

How do I solve the Colebrook-White equation for the Darcy friction factor?

POST a non-negative relative roughness ε/D (at most 0.05) and a turbulent Reynolds number (at least 4000). The API iterates Newton-Raphson on 1/√f = −2 log10(ε/D/3.7 + 2.51/(Re√f)) and returns friction_factor plus the residual.

What inputs does the Colebrook friction factor calculator need?

Two finite numbers: relative_roughness (ε/D, including 0 for a smooth pipe) and reynolds (Re ≥ 4000). Aliases such as rr, epsilon_d, e_d, re, and reynolds_number are accepted.

What does the Colebrook 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.

Read the full KIT documentation →