Traffic Density Calculator
Enter the number of vehicles on a road segment and its length to get traffic density instantly. Switch modes to solve for flow or speed using the fundamental flow-speed-density equation. You also get average headway between vehicles, a level-of-service (LOS) grade, and a step-by-step breakdown of the maths. Choose metric (vehicles/km, km/h) or imperial (vehicles/mile, mph) units.
What is traffic density?
Traffic density (also called occupancy density) is the number of vehicles present on a unit length of road at a given instant in time. It is usually measured in vehicles per kilometer (veh/km) or vehicles per mile (veh/mi), and it is one of three fundamental variables that describe traffic flow. The other two are traffic flow (vehicles per hour) and average travel speed. The three are linked by the fundamental equation: Flow = Speed x Density. If you know any two of them, you can calculate the third, which is why this calculator offers three modes.
How to calculate traffic density
The direct formula is: Density = Number of vehicles on segment / Length of segment. For example, if 80 vehicles are spread across a 2 km road, the density is 40 veh/km. For level-of-service (LOS) grading, divide the total density by the number of lanes to get the per-lane value. A per-lane density below 7 veh/km is LOS A (free flow), while anything above 28 veh/km is LOS F (breakdown). Average headway - the bumper-to-bumper gap between successive vehicles - is simply the reciprocal of density: headway (km) = 1 / density (veh/km), then multiply by 1,000 to get meters.
The fundamental flow-speed-density equation
Greenshields (1935) proposed the first mathematical model of traffic flow, based on the observation that average speed decreases linearly from the free-flow speed (no vehicles) down to zero at jam density (bumper-to-bumper gridlock). The resulting flow-density curve is a parabola that peaks at the capacity flow rate roughly halfway to jam density. Modern models such as Greenberg and Underwood use logarithmic or exponential speed-density curves for better fits, but the Greenshields linear model remains the standard teaching tool and is shown in the chart below. This calculator uses it to draw the flow-density curve for your unit system and a typical free-flow speed.
Level of service (LOS) explained
Level of service is a letter grade from A to F that summarises driver experience on a roadway, defined by the U.S. Highway Capacity Manual (HCM). For basic freeway segments, LOS is assigned based on per-lane density in veh/km. LOS A and B represent free-flow conditions where drivers have full choice of speed and lane. LOS C and D describe stable but increasingly constrained flow. LOS E means the road is at or near capacity, and any minor disturbance can trigger a queue. LOS F signals breakdown: demand exceeds supply, queues form and persist, and travel times become unpredictable. Urban planners typically aim to keep peak-hour conditions at LOS D or better.
Highway Capacity Manual - Level of Service thresholds (basic freeway segments)
| LOS | Density (veh/km/lane) | Conditions | Driver experience |
|---|---|---|---|
| A | 0 to 7 | Free flow | Complete freedom of speed and lane choice |
| B | 7 to 11 | Reasonably free flow | Slight restriction; drivers notice other vehicles |
| C | 11 to 16 | Stable flow | Perceptible interaction; less freedom to maneuver |
| D | 16 to 22 | Approaching unstable | Little freedom to maneuver; poor incident tolerance |
| E | 22 to 28 | Unstable flow | Near capacity; any disruption causes queues |
| F | 28 + | Breakdown / forced flow | Demand exceeds capacity; stop-and-go conditions |
Per-lane density thresholds from the HCM. LOS A = free flow; LOS F = breakdown. Values are in vehicles per kilometer per lane.
Frequently asked questions
What is the difference between traffic density and traffic flow?
Traffic density is how many vehicles occupy a stretch of road at one moment in time (vehicles per km or mile). Traffic flow, by contrast, counts how many vehicles pass a fixed point over a period of time (vehicles per hour). They are related by speed: flow = speed x density. A road can have high flow but moderate density if vehicles are moving fast, or high density but low flow when traffic crawls.
What is the typical jam density for a freeway?
Jam density is the maximum density at which traffic can no longer move - vehicles are bumper to bumper. For a single freeway lane, jam density is typically around 150-180 vehicles per kilometer (roughly 240-290 vehicles per mile). At that point, flow drops to zero and the average headway between vehicles equals the average vehicle length plus a small gap.
How is headway calculated from density?
Headway is the average distance (or time) between successive vehicles. Space headway in km = 1 / density (veh/km). Multiply by 1,000 to get meters. So if density is 40 veh/km, the average gap is 1/40 = 0.025 km, or 25 meters. Time headway in seconds = headway (m) / speed (m/s), assuming all vehicles travel at the mean speed.
What does LOS F mean and when does it occur?
LOS F indicates demand exceeds capacity. It occurs when per-lane density exceeds roughly 28 veh/km (about 45 veh/mi) on a freeway. Traffic operates in stop-and-go waves: vehicles decelerate to a stop, then creep forward as the queue discharges. LOS F typically happens during peak hours, after incidents, or at bottlenecks such as merges and lane drops.
Can I use this calculator for city streets instead of freeways?
Yes, the density and headway calculations apply to any road type. However, the LOS thresholds shown (and used in the gauge) are from the HCM for basic freeway segments. Urban arterials and signalised intersections use different LOS measures based on control delay rather than density, so treat the LOS grade as an approximation when applied to city roads.
What units does traffic density use?
In metric countries, traffic density is expressed in vehicles per kilometer (veh/km) or vehicles per kilometer per lane (veh/km/lane). In the United States and the UK, vehicles per mile (veh/mi) is common. The two are related by the conversion 1 mile = 1.60934 km, so 1 veh/mi = approximately 0.621 veh/km. This calculator lets you switch between metric and imperial units.