Traffic Density Calculator
Flow rate, speed, density & Level of Service — powered by Greenshields model
Results update instantly as you type. Switch tabs to explore all four calculation modes.
🚗 Density from Vehicle Count
Enter the number of vehicles on a road segment and its length to compute density.
Density (k)
—
veh/km
LOS Grade
LOS Description
—
🛣️ Flow Rate
Calculate flow q = k × u from density and speed, or from a vehicle count over a time period.
Flow (q)
—
veh/h
LOS Grade
LOS Description
—
⚖️ Fundamental Relationship — q = k × u
Enter any two of the three variables (q, k, u) to solve for the third.
Solved Variable
—
—
LOS Grade
LOS Description
—
📈 Greenshields Linear Model
Enter free-flow speed and jam density to derive the capacity curve and optimal operating point.
Optimal Density kopt
—
veh/km
Max Flow qmax
—
veh/h
Optimal Speed uopt
—
km/h
Current Speed u
—
km/h
Current Flow q
—
veh/h
LOS Grade
LOS Desc.
—
Traffic Flow Formulas Reference
Density
k = n / L
n = vehicles, L = length
Fundamental
q = k × u
flow = density × speed
Greenshields
u = uf(1 − k/kj)
linear speed model
Capacity
q_max = uf·kj / 4
at k_opt = kj / 2
Traffic Flow Theory: Density, Flow & Speed
Traffic engineering rests on three fundamental stream variables that describe the collective behaviour of vehicles on a roadway:
- Traffic Density (k) — the number of vehicles occupying a unit length of road at any given moment, measured in vehicles per kilometre (veh/km) or vehicles per mile (veh/mi). Density tells you how "packed" the road is right now.
- Traffic Flow Rate (q) — the number of vehicles passing a fixed point per unit time, measured in vehicles per hour (veh/h). Flow is what you'd count standing by the roadside with a stopwatch.
- Space-Mean Speed (u) — the average speed of all vehicles in a road section at a given moment, measured in km/h or mph. Space-mean speed differs from time-mean speed; it is the harmonic mean and more accurately reflects travel time.
The three are connected by the fundamental traffic flow equation:
This elegant relationship, analogous to flow = concentration × velocity in fluid mechanics, means that if you know any two variables you can instantly derive the third.
Greenshields Linear Speed-Density Model
In 1935, B.D. Greenshields proposed the first quantitative model of traffic flow. He observed that speed and density follow a linear (inverse) relationship: as density increases from zero towards jam density, speed decreases linearly from free-flow speed towards zero.
The model defines:
- Free-flow speed (uf) — speed when the road is empty (density → 0).
- Jam density (kj) — maximum density when traffic is at a complete standstill (speed = 0).
The speed-density equation becomes:
Substituting into q = k × u gives the flow-density parabola:
The parabola peaks at the optimal (capacity) point:
- Optimal density: kopt = kj / 2
- Maximum flow: qmax = uf × kj / 4
- Optimal speed: uopt = uf / 2
Despite its simplicity, Greenshields' model remains the foundation taught in transportation engineering courses worldwide. More complex models (Van Aerde, Underwood, Northwestern) refine it, but the fundamental shape — a flow-density parabola — persists.
Level of Service (LOS) — A through F
The Highway Capacity Manual (HCM), published by the Transportation Research Board, classifies operating conditions on freeways using Level of Service grades based on density thresholds:
| LOS | Density (pc/km/ln) | Description | Driver Experience |
|---|---|---|---|
| A | 0 – 7 | Free flow | Complete freedom to manoeuvre; very low density, high comfort. |
| B | 7 – 11 | Reasonably free flow | Slightly reduced freedom; speed slightly below free-flow. |
| C | 11 – 16 | Stable flow | Noticeable interaction with other vehicles; still stable. |
| D | 16 – 22 | Approaching unstable | High density; small increases in flow cause speed drops. |
| E | 22 – 28 | Unstable flow | Operating at or near capacity; minor disturbances cause breakdown. |
| F | > 28 | Forced / breakdown flow | Stop-and-go waves, queuing, demand exceeds capacity. |
Note: HCM LOS thresholds are for basic freeway segments in passenger car equivalents per kilometre per lane (pc/km/ln). Urban arterials and signalised intersections use different criteria.
Real-World Examples
Free-flow freeway (LOS A): At 6 am on a Sunday, an 8-lane motorway carries 4 vehicles per km per lane. Speed is near the posted limit of 110 km/h. Flow ≈ 440 veh/h/ln. Drivers experience maximum comfort and freedom.
Rush-hour freeway (LOS D/E): At 8 am on a Monday, density climbs to 20 veh/km/ln. Speed drops to around 70 km/h. Flow ≈ 1,400 veh/h/ln. Any minor incident now risks triggering stop-and-go waves that propagate upstream for kilometres.
Traffic breakdown (LOS F): An accident reduces a motorway to 2 lanes. Demand exceeds the reduced capacity; density surpasses 28 veh/km/ln. Speed oscillates between 5–30 km/h. Queues stretch back 10+ km. This is the classic gridlock scenario visible in satellite imagery.