Demurrage and detention calculator
Work out what the clock has already cost you - demurrage and detention, on tiered rates, across every container in the shipment.
Charges are per container per day. Special equipment - reefer, open top, flat rack - is on a separate and much higher scale.
Demurrage - the box is still inside the terminal
From your contract.
Discharge to gate-out.
Opening band.
How many chargeable days the rate above covers before it steps up.
Leave both blank to run the opening rate flat.
Detention - the box is out of the terminal, with you
Often a different allowance.
Gate-out to empty return.
Opening band.
Chargeable days before the rate steps up.
Leave both blank to run the opening rate flat.
Fill in whichever clock is running. Demurrage and detention are separate charges and either one works on its own.
-
-
-
The working
How this is calculated
Chargeable days = days used - free days (never below zero) Flat tariff: Cost per container = chargeable days x daily rate Tiered tariff: Band 1 days = lesser of chargeable days and band 1 length Band 2 days = chargeable days - band 1 days Cost per container = band 1 days x rate 1 + band 2 days x rate 2 Total = (demurrage + detention) x containers
Assumptions
- Demurrage and detention are separate charges on separate clocks and are calculated separately here. Demurrage is the box inside the terminal past free time; detention is the box outside the terminal, with you, past free time.
- Rates and free days are yours to supply. They vary by carrier, port, container type and contract, and any figure hardcoded into a calculator would be wrong for most people using it.
- The second rate band is optional. Leave it blank and the first rate runs flat, which the working states rather than assuming silently.
- Days are counted exactly as you enter them. Whether a tariff counts calendar days or working days, and whether it excludes weekends and holidays, differs between carriers.
- Reefer, open top, flat rack and other special equipment is charged on a separate and much higher scale than standard dry containers.
How to use this demurrage and detention calculator
Start with the number of containers, then fill in whichever side of the clock is running. Both sides are optional on their own - if only the box at the terminal is late, fill in demurrage and leave detention blank.
For each side you need three things: the free days your contract grants, the total days used, and the daily rate. The calculator subtracts free days from days used, never goes below zero, and multiplies out across your containers.
The two extra fields on each side are the ones that make this accurate rather than approximate. Almost every real tariff is tiered - a cheaper opening band, then a step up - so enter how many chargeable days the first rate covers and what the rate becomes after that. Leave them blank and the first rate runs flat, and the working says so explicitly rather than letting you assume a tiered tariff was handled.
Worked example
Two containers discharged at Felixstowe. Your contract gives 5 free demurrage days and 7 free detention days. Customs held the entry, so the boxes sat 12 days at the terminal, and once collected they were not returned empty for 11 days.
The tariff charges 90.00 a day for the first 5 chargeable demurrage days and 180.00 a day after that. Detention is 65.00 flat.
Demurrage chargeable days: 12 - 5 = 7. The first 5 fall in the opening band and 2 land in the second: 5 × 90.00 + 2 × 180.00 = 810.00 per container.
Detention chargeable days: 11 - 7 = 4, flat: 4 × 65.00 = 260.00 per container.
Per container that is 810.00 + 260.00 = 1,070.00, and across two containers, 2,140.00.
Now the number that actually matters: one more day costs another 180.00 of demurrage plus 65.00 of detention on each box, so (180.00 + 65.00) × 2 = 490.00 a day. That is what an overtime trucking slot or an expedited customs entry is competing against, and it is why the calculator prints it.
Why a flat rate understates the bill
Carriers do not set demurrage to make money on storage. They set it to get their equipment moving, which means the rate is engineered to become intolerable rather than merely annoying.
The practical shape of that is tiering. An opening band that looks survivable, then a step, and on many tariffs a third band several times the first. A delay that costs a modest amount over three days can cost many times that over twelve, and the curve bends upward exactly when a shipment is already in trouble.
Most calculators on the web take a single daily rate and multiply. That is fine for a two-day overrun and badly wrong for a two-week one - and nobody opens a demurrage calculator because everything is going smoothly. Entering the band length and the second rate takes ten seconds and is the difference between an estimate and a number you can take to a meeting.
The two clocks, and the day that gets billed twice
Demurrage and detention sound interchangeable and are not. The terminal gate separates them.
While the container is inside the terminal after discharge, waiting for you to collect it, demurrage runs. Once it passes the gate and is in your possession, detention runs, until the empty is returned to the nominated depot. One clock stops roughly where the other starts.
Roughly is the operative word, and it is where invoices get argued. The handover day is frequently claimed on both sides, and on a tariff where the later demurrage band is running at several hundred a day, a single disputed day is worth checking. Pin down the exact gate-out timestamp from the terminal, not from the trucker’s paperwork.
Storage is a third thing again, billed by the terminal for the ground the container occupies rather than by the carrier for its equipment. It can run in parallel with demurrage on the same box. Two invoices for the same days from two different parties is normal and not a duplicate.
Your dispute rights, if this is a US import
This is the part most calculators leave out entirely, and it is worth more than the arithmetic.
The Federal Maritime Commission’s Final Rule on detention and demurrage billing practices was issued on 23 February 2024 and took effect on 28 May 2024. It changed what a carrier or terminal has to do to make a charge stick:
- An invoice must be issued within 30 calendar days of the charges last being incurred. For a non-vessel-operating common carrier, within 30 calendar days of the invoice they received.
- The invoice must carry specific identifying information. Missing any of it eliminates the obligation to pay that charge - not reduces it, eliminates it.
- A billed party has at least 30 calendar days to request mitigation, a refund or a waiver, and the billing party must attempt to resolve the request within 30 calendar days unless both sides agree otherwise.
So before paying a large D&D invoice on a US import, check the date it was issued and check that it contains what the rule requires. An invoice that arrives four months later, or one that cannot show why the charge applies to you, is not automatically owed.
None of that applies outside US jurisdiction, and none of it is legal advice - but it is a documented, published rule, and it is the first thing to look at when the number in this calculator comes out uncomfortable.
Getting the free days right is worth more than getting the rate right
Every conversation about demurrage is about the daily rate, and the daily rate is the input you have least control over.
Free days are negotiable, and they are usually negotiated at booking, when nobody is thinking about them. Two extra free days on a lane where your customs clearance is routinely slow costs a fraction of what it saves, and the carrier is far more willing to discuss it before the container is on the water than after it has been sitting for a week.
The other lever is upstream of the port entirely. Most demurrage is caused by paperwork rather than by trucking - an entry filed late, an original bill of lading in transit, a payment not cleared, a release not issued. Clearing customs before arrival rather than after it removes the most common cause outright, and it costs nothing.
Frequently asked questions
How to calculate demurrage and detention charges?
What is the formula for calculating demurrage charges?
What is the difference between demurrage and detention?
How much does demurrage cost per day?
How many free days before demurrage?
What does "14 days free detention and demurrage" mean?
What are the detention charges for a 40-foot container?
Who pays demurrage charges in shipping?
What are MSC per diem charges?
How to avoid detention charges?
Why did my demurrage bill jump after a few days?
Can demurrage and detention charges be disputed or waived?
Related calculators
Sources & methodology
- US Federal Maritime Commission - Final Rule on Detention and Demurrage Billing Practices, issued 23 February 2024, effective 28 May 2024 (30-day invoicing deadline, 30-day dispute window, invoices missing required information carry no obligation to pay). Checked 26 August 2026.
- US Federal Maritime Commission - Detention and Demurrage overview (detention is charged for extended use of intermodal equipment; demurrage accrues when a container exceeds free time on a marine terminal). Checked 26 August 2026.
Last updated
Results are estimates for planning purposes. Verify with your carrier or customs broker before committing. This is not professional advice - see the disclaimer.
Every calculation runs in your browser. Nothing you type is sent to a server or stored anywhere.