Traffic Density Calculator

Turn vehicle counts and a road length into flow, density, speed and headway.

Six time scales, nine length units and six speed units, metric or imperial.

Updated November 28, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

What the four quantities measure

Traffic on a road is described by four numbers, and they are not interchangeable measurements of the same thing. Two of them are counted over time, two are read from a single moment.

The calculator keeps all four consistent by working in metres and seconds underneath, and then showing the answer in whichever unit you picked. That is why a flow quoted per hour, a density quoted per kilometre and a speed quoted in kilometres per hour still agree with each other exactly: the conversion happens before the arithmetic, not after it.

Four quantities

Two counted over time, two read at one instant

Four relationships

Any box is solved from the ones you fill in

Four unit menus

Window, flow rate, length and speed

Traffic flow

How many vehicles pass one point in a given time. Engineers quote it per hour, so a junction carrying 900 vehicles between 08:00 and 08:30 is running at:

flow\mathrm{flow}==9000.5 h\frac{900}{0.5\ \mathrm{h}}==1,800 veh/h1{,}800\ \mathrm{veh/h}

Traffic density

How many vehicles occupy a stretch of road at one instant. Twenty vehicles spread over a kilometre of lane is 20 veh/km20\ \mathrm{veh/km}, and it says nothing about how fast anybody is moving.

Average travel speed

How fast the vehicles on that stretch are actually moving, not the posted limit. This is the number that falls first when a road gets busy.

Headway

The front-to-front distance between one vehicle and the next. It is the reciprocal of density, so a density of 20 veh/km20\ \mathrm{veh/km} is a headway of 50 m50\ \mathrm{m}.

Why three of them are called fundamental

The three big ones — flow, density and speed — are called the fundamental characteristics of a traffic stream because any two of them fix the third. Count the vehicles through a point, count the vehicles on a measured stretch, and the calculator can tell you the average speed without a speed gun anywhere in sight.

How to use the calculator

1

Count what passes a point, during a window you timed

Enter how many vehicles passed and how long you watched. That pair gives the traffic flow, and the flow box shows it in the rate unit you picked:

flow\mathrm{flow}==3060 s\frac{30}{60\ \mathrm{s}}==0.5 veh/s0.5\ \mathrm{veh/s}==1,800 veh/h1{,}800\ \mathrm{veh/h}
2

Count what occupies a stretch you measured

Enter the vehicles you can see on the stretch and its length. The headway box fills itself in from the density you have just produced:

density\mathrm{density}==4200 m\frac{4}{200\ \mathrm{m}}==0.02 veh/m0.02\ \mathrm{veh/m}==20 veh/km20\ \mathrm{veh/km}
headway\mathrm{headway}==10.02\frac{1}{0.02}==50 m50\ \mathrm{m}
3

Add a speed, or stop whenever the answer you need is filled

With a density and a flow already in place, the speed box resolves itself. If instead you know the speed from a sign or a GPS trace, type it and the flow will resolve against the density you measured. Any box you fill in becomes a given, and any box you leave empty is the calculator's job.

Two boxes share one name on purpose

Both groups start with a box called “No. of vehicles”, and they are not the same measurement. The first counts vehicles that pass a point while you watch; the second counts vehicles standing on a stretch at one instant. Mixing them up gives a density that is really a flow, or the other way around.

The four relationships

Four statements describe the whole calculator. One relates all three of the fundamental quantities, and three are simple divisions that fill in the rest.

1. Flow from density and speed

flow=density×speed\mathrm{flow} = \mathrm{density} \times \mathrm{speed}

The fundamental identity. It only holds without a correction factor when density is vehicles per metre and speed is metres per second, which is exactly how the calculator stores both before showing them in your chosen unit. Either factor can be solved back from the other two:

density\mathrm{density}==flowspeed\frac{\mathrm{flow}}{\mathrm{speed}}density from a rate and a speed
speed\mathrm{speed}==flowdensity\frac{\mathrm{flow}}{\mathrm{density}}the average speed without measuring one

2. Flow from a counted window

A count divided by the time it took. Reverse it when you know the rate and want the number of vehicles a longer window should deliver, or the window a rate implies for a count you already have.

flow\mathrm{flow}==nt\frac{n}{t}
nn==flow×t\mathrm{flow} \times tthe count a window should carry
tt==nflow\frac{n}{\mathrm{flow}}how long the count implies you watched

3. Density from a measured segment

A count divided by a length. This is a snapshot, so the vehicles have to be on the segment at the moment you look — not a total that accumulated over the afternoon.

density\mathrm{density}==mL\frac{m}{L}
mm==density×L\mathrm{density} \times Lvehicles that density puts on the stretch
LL==mdensity\frac{m}{\mathrm{density}}the stretch those vehicles need

4. Headway is one over density

headway=1density\mathrm{headway} = \frac{1}{\mathrm{density}}

If a kilometre of lane holds 20 vehicles, the average front-to-front spacing is a kilometre divided by 20, or 50 m. The relation runs both ways, so a headway you can measure from the roadside gives you the density directly:

density\mathrm{density}==1headway\frac{1}{\mathrm{headway}}density from a measured gap

What the unit menus actually do

Nothing reaches the arithmetic in the unit you typed it. Every entry is normalised into metres and seconds first, and every factor below is the exact definition rather than a rounded convenience value:

flowveh/s\mathrm{flow}_{\mathrm{veh/s}}==flowveh/h3600\frac{\mathrm{flow}_{\mathrm{veh/h}}}{3600}\qquadspeedm/s\mathrm{speed}_{\mathrm{m/s}}==speedkm/h3.6\frac{\mathrm{speed}_{\mathrm{km/h}}}{3.6}
EntryConversion into the formula’s base
vehicles per hourdivide by 3,600 to get vehicles per second
vehicles per kilometredivide by 1,000 to get vehicles per metre
kilometresmultiply by 1,000 to get metres
milesmultiply by 1,609.344
nautical milesmultiply by 1,852
kilometres per hourdivide by 3.6 to get metres per second
miles per hourmultiply by 0.44704
feet per secondmultiply by 0.3048
feet per minutemultiply by 0.00508
knotsmultiply by 1,852, then divide by 3,600
monthsone twelfth of a Julian year, 2,629,800 seconds

That is why switching the unit menu never changes an answer, only how it is written.

flow\mathrm{flow}Vehicles passing one point per unit of time.
density\mathrm{density}Vehicles occupying one unit of road length at an instant.
speed\mathrm{speed}Average travel speed of the vehicles on that stretch.
headway\mathrm{headway}Front-to-front distance between consecutive vehicles.
nnVehicles counted through the point during the window.
ttLength of the observation window.
mmVehicles counted on the segment at one instant.
LLLength of that segment.

A worked example on one lane

One measurement session, one lane, and every box on the page filled in. This is the situation the three groups are designed for: a count over time and a snapshot of a stretch, taken at the same moment.

1

One lane, two lamp posts and a minute of counting

Situation: You are watching a single lane between two lamp posts 200 m apart. At 09:30 there are four vehicles between the posts, and during the following minute thirty vehicles pass the far post. That is enough to describe the lane completely.

What goes in

Window1 min
Passed the post30
On the segment4
Segment length200 m

What comes out

flow\mathrm{flow}==3060 s\frac{30}{60\ \mathrm{s}}==0.5 veh/s0.5\ \mathrm{veh/s}==1,800 veh/h1{,}800\ \mathrm{veh/h}
density\mathrm{density}==4200 m\frac{4}{200\ \mathrm{m}}==0.02 veh/m0.02\ \mathrm{veh/m}==20 veh/km20\ \mathrm{veh/km}
headway\mathrm{headway}==10.02\frac{1}{0.02}==50 m50\ \mathrm{m}
speed\mathrm{speed}==0.5 veh/s0.02 veh/m\frac{0.5\ \mathrm{veh/s}}{0.02\ \mathrm{veh/m}}==25 m/s25\ \mathrm{m/s}≈\approx90 km/h90\ \mathrm{km/h}

In practice: A 50 m spacing at 25 m/s is a time gap between vehicles of two seconds. That is the number drivers actually feel, and it closes the loop: one vehicle every two seconds works out to the same 1,800 vehicles per hour that you counted. When a counted flow and an observed time gap disagree like this, one of the two measurements is wrong, and that arithmetic is worth doing before you trust either.

Turn the distance into a time gap, and check it

The speed was never measured — the fundamental identity produced it from the count and the snapshot. Divide the headway by that speed and the answer becomes a time gap, which is what a driver following another car can actually judge:

headwayspeed\frac{\mathrm{headway}}{\mathrm{speed}}==50 m25 m/s\frac{50\ \mathrm{m}}{25\ \mathrm{m/s}}==2 s2\ \mathrm{s}

Two seconds per vehicle and 1,800 vehicles per hour are the same statement. If they ever disagree for a road you measured, the count or the segment length is off, not the formula.

Reading density and headway

Density is the quantity traffic engineers reach for when they want to describe congestion, because it does not depend on the speed limit. The gaps below are the exact headways the calculator returns for each density, so they are a conversion table rather than a set of opinions. The descriptions are a rough guide for one lane of mixed light vehicles.

DensityHeadwayWhat the lane looks like
under 10 veh/kmover 100 mFree flow; the gaps are longer than most junctions.
10 to 30 veh/km33 to 100 mLight traffic; you can join from a side road comfortably.
30 to 60 veh/km17 to 33 mBusy; speeds start to sit below the limit.
60 to 100 veh/km10 to 17 mHeavy; a four-second hesitation from anyone ripples backwards.
100 to 150 veh/kmunder 10 mAt or near the jam density for cars; the flow itself is falling.
over 150 veh/kmunder 6.7 mA standing queue rather than moving traffic.

These numbers are per lane

A three-lane carriageway at 40 vehicles per kilometre per lane reads 40 in the density box if you measured one lane, and 120 if you counted all three. Neither is wrong, but the two cannot be compared against the same per-lane reference. Decide before you count, and keep the count, the length and the lane count describing the same piece of road.

Measuring advice

The arithmetic is exact; the uncertainty lives in the count and the measured length. A few habits keep the result inside the accuracy a manual survey can honestly claim.

Watch for at least five minutes

At a busy rate of 1,800 vehicles per hour, five minutes covers about 150 vehicles, which is enough for a stable rate. A one-minute count is dominated by whether a platoon happened to arrive. The window can be any length you like; a longer one costs nothing here.

Measure the segment on a map, not by pacing

The length is the denominator of the density, so a 10% error in the length is a 10% error in density. Use a mapping tool or an odometer between two landmarks, and pick landmarks you could stand at — a lamp post, a sign, a bridge joint.

Keep the count and the snapshot at the same time

Flow is averaged over the window; density is a single instant. On steady traffic the two simply combine. At the moment a queue forms or clears they describe different regimes, and the average speed you get out will be a blend of the before and after.

Repeat at peak and off-peak

The result is one rate for one moment, not a daily average. Running the same measurement at 08:30 and at 11:00 is often more informative than any single number.

The same arithmetic works for pedestrians and bicycles

Count people through a gate or bicycles along a path and the four relationships hold exactly as they do for cars, as long as you read “vehicle” as one unit of whatever you are counting. It is the density comparisons that stop transferring — a crowd and a car park do not jam at the same spacing.

Assumptions and limits

Steady traffic is assumed

The fundamental identity relates long-run averages. A gap in which nothing arrives and a platoon that arrives together average out to a flow that describes neither, so read the result as a rate for a road that is behaving consistently over the window you measured.

Headway here is a distance, not a time

The headway box is the front-to-front spacing in metres. The two-second rule and everything quoted in seconds is a time headway, which is that distance divided by the speed. Both are useful; they are not the same number.

Density is capped at a physically possible value

A density above 500 vehicles per kilometre (half a vehicle per metre) leaves two metres of road per vehicle, which no car, van or lorry queue can achieve. The calculator keeps the number visible and flags it rather than pretending it solved something.

The flow warning is per-lane capacity

Above 7,200 vehicles per hour through one point the result is flagged: a single lane peaks near 2,400. If you counted several lanes at once, the number is legitimate and the flag is a reminder to divide by the lane count before comparing with per-lane figures.

Not a substitute for a traffic survey

A manual count is fine for understanding a road, checking a congestion complaint or sanity-checking a transport model. Statutory counts, junction design, signal timing and anything with a safety case need calibrated counters and a qualified highway engineer; a phone timer and a pair of lamp posts are not that.

Questions that come up

Q

Why can the flow be zero when vehicles are present?

Flow counts vehicles crossing a point per unit time, so it drops to zero in two very different situations: an empty road, and a completely stationary queue. Density tells them apart — near zero for the empty road, at jam density for the queue. If you see a zero flow with a high density, you have found a jam rather than a quiet road.

Q

Which of the two vehicles boxes do I fill in?

Fill the one in the Traffic flow group if the vehicles were moving past you — a tally over time. Fill the one in the Traffic density group if they are spread out on a stretch you can see right now — a snapshot. If both apply, fill both: they are independent measurements of the same road and together they pin the speed down.

Q

How accurate can a roadside count be?

For short manual counts, a few percent either way is realistic; heavy vehicles, dark and rain make it worse. The arithmetic is exact, so the uncertainty in the answer is the uncertainty in your count and your measured length, not in the formula. That is also why the calculator keeps every digit it can rather than rounding to whole vehicles.

Q

Does the direction of travel matter?

Yes. These quantities are per direction of travel, so vehicles going the other way are not part of the count. On a divided carriageway that is natural; on a two-way road, pick one direction and stay with it for both the count and the segment snapshot.

Q

Can I use it for pedestrians or bicycles?

The algebra is the same for any stream of things — people through a gate, bicycles on a path — as long as you read “vehicle” as one unit of whatever you are counting. The density ceiling and the capacity warning are calibrated for motor traffic, so treat them as loose sanity checks rather than limits for a crowd.

Traffic Density Calculator - Flow, Density and Average Speed