Demurrage and detention are among the largest avoidable costs in container logistics — invisible until the invoice lands, and often running into thousands of dollars per box. The good news: most of it is preventable. This guide explains how the D&D clock actually works, why charges escalate so fast, the operational fixes that cut them, and how AI turns a nasty surprise into a managed risk.
How the D&D clock works
The two charges are easy to confuse, and getting them straight is the first step to controlling them. Demurrage accrues while a container is still inside the port or terminal past its free time. Detention accrues after the container has left the port but has not been returned empty to the line's depot in time. Together they are "D&D". Each has its own free-time allowance — typically a few days — after which the meter runs per container, per day.
A single import can incur demurrage (box stuck at the terminal awaiting customs) and detention (empty returned late) on the same journey. Controlling D&D means watching both clocks, on every container.
Why charges escalate
D&D rates are almost always tiered: the daily charge rises after the first few chargeable days, often doubling. So the cost of a delay is not linear — a container that sits a week can cost far more than seven times a one-day slip. Multiply that across a fleet of shipments and the leakage is substantial. Reefers are worse still: scarcer equipment and running-power costs mean higher rates and faster escalation. The lesson is that D&D punishes exactly the delays that are easiest to let slide.
The operational fixes
Most D&D is avoidable with disciplined execution. The highest-impact fixes:
- Clear customs early — pre-file declarations so the box isn't waiting on paperwork while demurrage runs.
- Pre-arrange transport — have haulage and delivery booked before the vessel arrives, not after.
- Monitor free-time expiry — track the free-day deadline on every container and act before it lapses.
- Return empties promptly — unpack and return the empty within the detention window; don't let boxes sit at the warehouse.
- Negotiate free time — for regular lanes, negotiate longer free time into the carrier contract up front.
- Audit the charges — carrier D&D invoices contain errors; check them against the free-time terms before paying.
Predicting exposure with AI
The operational fixes work far better when you know which containers are at risk before charges start. This is where AI earns its keep: by predicting D&D exposure per container from the shipment's status, lane and history, it flags the boxes trending toward charges early — so the team clears customs, books transport or returns the empty while there is still time. It also audits D&D invoices against the agreed free time, catching billing errors. The result is that D&D moves from an after-the-fact cost to a risk you manage in advance.
Related reading
- Demurrage and Detention — the terms, formulas and worked examples.
- Supply Chain Visibility — seeing the containers at risk in time to act.
- Shipping & Logistics ERP — the platform that tracks D&D across every shipment.