Disclosure: I maintain the public calculator linked in this post. The code patterns below are the ones that tool uses, and every number can be reproduced without it.

A paving quote says "145 pounds per cubic foot." A supplier in Europe quotes "2,320 kilograms per cubic meter." A developer converts one to the other, gets it wrong by 3%, and nobody notices until 200 tons have been delivered short.

I built a public asphalt tonnage calculator and this was the single most common source of bad output. Here is the conversion logic, the traps, and the tests that caught them.

The two density scales

Hot-mix asphalt planning density is conventionally 145 lb/ft3 (US) or about 2,320 kg/m3 (metric). The exact conversion factor is:

1 lb/ft3 = 16.018463 kg/m3 145 lb/ft3 = 2,322.68 kg/m3 

The trap is that people round 145 x 16 to 2,320 - which is fine for a driveway and wrong by eight tons over a 200-ton job when the other side uses the full constant. Use the full constant and round only at display time.

The other trap is confusing mass density with the loose bulk density of aggregate. Base stone is quoted in different units entirely (tons per cubic yard, or kg per m3 at a different density), so a single shared "density" field in your data model will silently produce wrong results when the material type changes. Keep density as a property of the material, not a global constant.

The formula, in both unit systems

US customary, compacted thickness in inches:

// net tons = area(sq ft) * thickness(in)/12 * density(lb/ft^3) / 2000 const netTons = (areaSqFt * thicknessIn / 12) * densityLbFt3 / 2000; 

Metric, compacted thickness in meters and density in kg/m3:

// metric tonnes = area(m^2) * thickness(m) * density(kg/m^3) / 1000 const tonnes = (areaM2 * thicknessM) * densityKgM3 / 1000; 

Write both. If you only implement US units and convert the inputs, you inherit every rounding error in the conversion chain.

Net tons versus order tons

This is the bug that actually costs money. Net tons is the asphalt in the finished pavement. Order tons adds an allowance once - for edges, cuts, spill, and measurement error. A typical allowance is 5%:

const orderTons = netTons * (1 + allowancePct / 100); 

The mistake I saw repeatedly: applying a "compaction factor" on top. The tonnage formula already uses compacted volume at compacted density. Adding a second compaction percentage charges the customer for the same material twice. Apply the allowance exactly once, and expose it as an editable input so the user can set it to 0, 3, 5, 7, 10, or their own number.

Coverage tables are a derived view, not a second source of truth

A coverage chart (square feet per ton at 1.5, 2, 2.5, 3, 4, 5, 6 inches) should be computed from the same formula, never hardcoded:

const sqFtPerTon = 24000 / (densityLbFt3 * thicknessIn); // 24,000 = 2,000 lb/ton * 12 in/ft 

I wrote a test that regenerates the table at three densities (142, 145, 148 lb/ft3) and checks that doubling thickness halves coverage. That test caught a refactor that had accidentally swapped thickness and density.

The loose-versus-compacted trap

Dense-graded hot mix rolls down by roughly a quarter. If a user enters a loose lift depth into a formula that expects compacted thickness, the tonnage is overstated by about 33%. The UI has to say "compacted" in the field label, not in a footnote. If the only number available is loose, convert it before it reaches the formula and keep both values visible.

You can see this logic applied in the asphalt tonnage calculator: net and order tons are separate outputs, the seven-step derivation is shown, and the coverage table regenerates when density changes. The aggregate base calculator is deliberately a separate tool - base stone has its own units and should never share a density field with the surface mat.

Takeaway

Three rules that prevented nearly every bad number: keep density as a material property, apply the order allowance once, and derive every display table from the same formula. The arithmetic is simple; the data modeling is where the money leaks.

These are planning estimates, not engineering design. Traffic, subgrade, drainage, and local specifications decide the real pavement structure.