ShipCalculators.com

How much detention is due on this container?

Container detention and combined demurrage and detention · free time in working or calendar days from the day of interchange · three day bands · Hapag-Lloyd and Maersk tariffs or your own · US invoice deadline under 46 CFR 541 · Updated 18 October 2026

Published by ShipCalculators.com. Method checked against 46 CFR Part 541, 46 CFR 545.5 and Hapag-Lloyd USA Detention tariff, 1 October 2025 on 18 October 2026. How calculators are checked

Answer

Detention is charged for each calendar day after the last free day at its tariff band's rate, times the containers. Under Hapag-Lloyd's USA import merchant-haulage tariff of 1 October 2025, outside California, a dry container out on 2 March 2026 and back on 24 March has 5 free days and 18 charged: USD 4,950 a box, USD 24,750 for five.

Change the inputs below to recompute.

On this page

What container detention is

Container detention is the daily charge a carrier makes for its container while the merchant keeps it outside the terminal or depot beyond the free time in the tariff or service contract; demurrage is the charge while the full container stays inside.8 Free time starts on the day of interchange and ends on the last free day (LFD), and in US tariffs it counts working days, while the charge after it counts calendar days outside California.6,9 US regulation, 46 CFR 541.3, treats demurrage, detention and per diem as one term and sets what the invoice must show and when it must be issued.1

Work out the detention charge

Start from a situation, or enter your own below

1The tariff

The service contract if one covers the shipment, otherwise the carrier’s detention tariff for the country and the move type.

2The containers

Size and type from the booking or the bill of lading.

Containers on these dates

3The dates

Gate-out from the equipment interchange receipt, return from the depot’s gate-in receipt.

Days on the clock, gate-out to return, both counted

last free day, day 5

Closed days inside free time

MonTueWedThuFriSatSun2 MarMon 2 Mar 2026: free day 12F1Tue 3 Mar 2026: free day 23F2Wed 4 Mar 2026: free day 34F3Thu 5 Mar 2026: free day 45F4Fri 6 Mar 2026: free day 56F5Sat 7 Mar 2026: charged at USD 2007200Sun 8 Mar 2026: charged at USD 20082009 MarMon 9 Mar 2026: charged at USD 2009200Tue 10 Mar 2026: charged at USD 25010250Wed 11 Mar 2026: charged at USD 25011250Thu 12 Mar 2026: charged at USD 25012250Fri 13 Mar 2026: charged at USD 30013300Sat 14 Mar 2026: charged at USD 30014300Sun 15 Mar 2026: charged at USD 3001530016 MarMon 16 Mar 2026: charged at USD 30016300Tue 17 Mar 2026: charged at USD 30017300Wed 18 Mar 2026: charged at USD 30018300Thu 19 Mar 2026: charged at USD 30019300Fri 20 Mar 2026: charged at USD 30020300Sat 21 Mar 2026: charged at USD 30021300Sun 22 Mar 2026: charged at USD 3002230023 MarMon 23 Mar 2026: charged at USD 30023300Tue 24 Mar 2026: charged at USD 30024300Wed 25 Mar 202625Thu 26 Mar 202626Fri 27 Mar 202627Sat 28 Mar 202628Sun 29 Mar 2026295 free days, to Fri 6 Mar0 off days in free time3 × USD 200 = USD 6003 × USD 250 = USD 75012 × USD 300 = USD 3,600Outlined: out 2 Mar, in 24 Mar

Your dates on a calendar as you type: green free, amber charged, darker for each band.

4The invoice, optional

A US invoice prints the free time, its start and end dates and the dates charged (46 CFR 541.6(b)); its date checks the 30-day rule in 541.7(a).

Amount invoiced, optional

this count 24,750

5 × 40 ft dry (regular) on Hapag-Lloyd US, out Mon 2 Mar 2026, back Tue 24 Mar 2026: 23 days on the clock, 5 free, Monday to Friday after day 1.

Detention USD 24,750, 18 days charged

Detention charge
Detention due
USD 24,750

USD 4,950 a container × 5

Each further day: USD 1,500 (USD 300 a container)

18 days charged after free time ended on Fri 6 Mar: USD 4,950 a container, USD 24,750 for 5 containers.

  1. OutMon 2 Mar
  2. Last freeFri 6 Mar
  3. First chargedSat 7 Mar
  4. ReturnedTue 24 Mar

A container returned by

  • Last free dayby Fri 6 MarUSD 0
  • Band 1 endsby Mon 9 MarUSD 600
  • Band 2 endsby Thu 12 MarUSD 1,350
  • Each day afterfrom Fri 13 Mar+USD 300
  • Your returnTue 24 MarUSD 4,950

Check against the invoice

Tariff
Hapag-Lloyd US
Free time
5 days
Free time start
Mon 2 Mar
Free time end
Fri 6 Mar
Dates charged
7 Mar to 24 Mar
1st period
3 × 200
2nd period
3 × 250
Thereafter
12 × 300
Invoice due by
Thu 23 Apr
Total
USD 24,750
Returned on another day
The same containers returned on another day
ReturnedTotal
Tue 17 MarUSD 14,250
Sat 21 MarUSD 20,250
Mon 23 MarUSD 23,250
Tue 24 MarUSD 24,750
Wed 25 MarUSD 26,250

For a US move, the invoice is due by Thu 23 Apr under 46 CFR 541.7(a), 30 days after the return.

What this detention charge means

The container was on the clock for 23 days, from Mon 2 Mar 2026 to Tue 24 Mar 2026, both counted. Hapag-Lloyd US gives 5 free days for a dry (regular) box, counting day 1 and then Monday to Friday, so free time ran to Fri 6 Mar 2026.

Every calendar day after that is charged, 18 days up to the return. 3 × 200 + 3 × 250 + 12 × 300 = USD 4,950; × 5 = USD 24,750. The last band's rate is 1.50 times the first, so each further day now costs USD 300 a container.

For a US move, the carrier must issue the invoice by Thu 23 Apr 2026, 30 calendar days after the charge was last incurred (46 CFR 541.7(a)), and the invoice must print the free time, its start and end dates and the dates charged (541.6(b)).

Cite or share this calculation

ShipCalculators.com, “Container Detention Charges Calculator: Free Days and Bands.” Method: free time counted from the day of interchange, then each calendar day to the return priced at its tariff band. Inputs: Hapag-Lloyd USA import, merchant haulage, excl. California, 1 Oct 2025; 40 ft dry (regular); out Mon 2 Mar 2026, returned Tue 24 Mar 2026; 5 containers. Result: last free day Fri 6 Mar 2026; 18 days charged; USD 4,950 a container, USD 24,750 in total. https://shipcalculators.com/calculators/container-detention

The citation names ShipCalculators.com as publisher; copying it adds today's date.

Calendar of your container's days

Calendar, Monday to Sunday

MonTueWedThuFriSatSun2 MarMon 2 Mar 2026: free day 12F1Tue 3 Mar 2026: free day 23F2Wed 4 Mar 2026: free day 34F3Thu 5 Mar 2026: free day 45F4Fri 6 Mar 2026: free day 56F5Sat 7 Mar 2026: charged at USD 2007200Sun 8 Mar 2026: charged at USD 20082009 MarMon 9 Mar 2026: charged at USD 2009200Tue 10 Mar 2026: charged at USD 25010250Wed 11 Mar 2026: charged at USD 25011250Thu 12 Mar 2026: charged at USD 25012250Fri 13 Mar 2026: charged at USD 30013300Sat 14 Mar 2026: charged at USD 30014300Sun 15 Mar 2026: charged at USD 3001530016 MarMon 16 Mar 2026: charged at USD 30016300Tue 17 Mar 2026: charged at USD 30017300Wed 18 Mar 2026: charged at USD 30018300Thu 19 Mar 2026: charged at USD 30019300Fri 20 Mar 2026: charged at USD 30020300Sat 21 Mar 2026: charged at USD 30021300Sun 22 Mar 2026: charged at USD 3002230023 MarMon 23 Mar 2026: charged at USD 30023300Tue 24 Mar 2026: charged at USD 30024300Wed 25 Mar 202625Thu 26 Mar 202626Fri 27 Mar 202627Sat 28 Mar 202628Sun 29 Mar 2026295 free days, to Fri 6 Mar0 off days in free time3 × USD 200 = USD 6003 × USD 250 = USD 75012 × USD 300 = USD 3,600Outlined: out 2 Mar, in 24 Mar

Each square a day: F1 to F5 the free days, off a day free time does not count, the figure in a charged day its rate. Navy outline: gate-out and return.

Cost per container, day by day

USD 4,950 a container by Tue 24 Mar 2026Free to 6 MarUSD 600 by 9 MarUSD 1,350 by 12 MarUSD 4,950 by 24 Marout 2 Marin 24 Mar

Flat through free time, then rising at each band's daily rate.

The clock to scale

5 days3 days3 days12 days5 free days, to Fri 6 Mar0 off days in free time3 × USD 200 = USD 6003 × USD 250 = USD 75012 × USD 300 = USD 3,600
The container left on Mon 2 Mar 2026 and came back on Tue 24 Mar 2026. Free time ran to Fri 6 Mar 2026. 18 days were charged: 3 × 200 + 3 × 250 + 12 × 300 = USD 4,950; × 5 = USD 24,750.

Your charge worked day by day

  1. Days on the clock: Mon 2 Mar 2026 to Tue 24 Mar 2026, both counted: 23 days.
  2. Free time: 5 days (DOI + 4 WD), day 1 on Mon 2 Mar, then Monday to Friday: last free day Fri 6 Mar 2026.
  3. Days charged: Tue 24 Mar less Fri 6 Mar = 18 days.
  4. 1st period: 3 × USD 200 = USD 600.
  5. 2nd period: 3 × USD 250 = USD 750.
  6. Thereafter: 12 × USD 300 = USD 3,600.
  7. Per container: USD 4,950; for 5 containers: USD 24,750.
  8. US invoice due by: Tue 24 Mar 2026 + 30 days = Thu 23 Apr 2026.

Counting detention by hand

Start on the day the container left the terminal: that day is free day 1. Count on through the working days in the tariff, skipping weekends where it says working days, until you reach the number of free days; that is the last free day. Every calendar day after it, up to and including the return day, is charged. Charge the first band’s days at the first rate, the next band’s at the second rate and every day after that at the third, add them up, and multiply by the number of containers.

Formula, assumptions, and limits

A detention charge is the number of days charged in each band of the tariff, times that band’s daily rate, summed and multiplied by the number of containers. The days charged start the day after the last free day and end on the day the container is returned. Free time is counted from the day the container leaves the terminal, and in US tariffs it counts working days only, so a weekend inside the free time moves the last free day later.

Formula

C=N∑i=13ri diD=max⁡(0,  t1−tLFD)C = N \sum_{i=1}^{3} r_i\, d_i \qquad D = \max\left(0,\; t_1 - t_{LFD}\right)d1=min⁡(D, b1)d2=min⁡(max⁡(D−b1, 0), b2)d3=max⁡(D−b1−b2, 0)\begin{aligned} d_1 &= \min(D,\, b_1) \\ d_2 &= \min\left(\max(D - b_1,\, 0),\, b_2\right) \\ d_3 &= \max(D - b_1 - b_2,\, 0) \end{aligned}
  • CC: the charge, in the tariff’s currency.
  • NN: containers on the same dates and the same tariff.
  • t0t_0: the day the clock starts, the day of interchange (gate-out full at import), counted as free day 1.
  • t1t_1: the day the empty container is gated in, charged in full.
  • FF: free days, day 1 included; the last free day tLFDt_{LFD} is the FF-th counted day from t0t_0.
  • DD: calendar days charged after the last free day.
  • b1b_1, b2b_2: the lengths of the first two charged bands in days; the third band runs to the return.
  • rir_i: the daily rate in band ii, per container.

Derivation

The method is the tariff’s own table read row by row. Hapag-Lloyd’s USA Detention tariff of 1 October 2025 prints free time as “DOI+4WD”, the day of interchange plus four working days, then a “1st Period” of 3 calendar days, a “2nd Period” of 3 calendar days and “Thereafter”. Each day is priced at the rate of the period it falls in; neither the Hapag-Lloyd nor the Maersk tables reprices earlier days at a later band’s rate. Maersk numbers its bands from the start of the clock (“Day 1 to 4 Free”, “Day 5 to 8”), which is the same arithmetic with the band lengths read off as 4, 4 and the rest.

Assumptions

  • Day 1 of the clock is a free day whatever the weekday, as “DOI” in the Hapag-Lloyd tariff and “commences on the day equipment departs” on Maersk’s US page.
  • After day 1, free time counts only the working days chosen (Monday to Friday, Monday to Saturday, or every day). Each closed day entered adds one counted day, the rule in section G of Hapag-Lloyd’s May 2026 guide.
  • Days after the last free day are charged as calendar days, weekends and holidays included, up to and including the return day.
  • The same rate applies to every container in the count.

Worked example

A 40 ft dry container leaves the terminal under Hapag-Lloyd import merchant haulage, outside California, on Monday 2 March 2026 and is returned on Tuesday 24 March 2026. Five such containers moved together.

  1. Free time is the day of interchange plus 4 working days: Monday 2, then Tuesday 3 to Friday 6 March. The last free day is Friday 6 March.
  2. Days charged: Saturday 7 to Tuesday 24 March, 18 calendar days.
  3. 1st period: 3 days × USD 200 = USD 600.
  4. 2nd period: 3 days × USD 250 = USD 750.
  5. Thereafter: 12 days × USD 300 = USD 3,600.
  6. Per container USD 4,950; for 5 containers USD 24,750.

The same box out on Thursday 5 March has its last free day on Wednesday 11 March, because Saturday 7 and Sunday 8 are not working days. Counting calendar days instead puts the last free day on Monday 9 March and with the return still on 24 March, overcharges 2 days at the top rate, USD 600 a box.

Edge cases and limits

A container returned on or before the last free day costs nothing: with the 2 March gate-out, a return on Friday 6 March is USD 0 and on Saturday 7 March USD 200. A return date before the gate-out date is refused. The calculator draws at most 16 weeks of the calendar; longer stays are counted in full and the drawing says which weeks it shows.

Hapag-Lloyd’s California tables charge per working day, not per calendar day, and Maersk’s Philadelphia reefer and meat tables have their own bands. Neither is a preset here: enter them as your own tariff, and count the charged days by hand where they are working days.

Regulatory basis

No regulation sets the rates; the carrier’s tariff or the service contract does. In the United States the Federal Maritime Commission regulates the billing: 46 CFR Part 541, in force since 28 May 2024 under the Ocean Shipping Reform Act of 2022, sets the invoice contents and the 30-day deadlines, and 46 CFR 545.5, the 2020 interpretive rule, sets how the Commission judges whether a practice is reasonable.

Common errors

  • Counting free time in calendar days when the tariff says working days, which ends free time early after any weekend.
  • Leaving the day of interchange out of the free time, or counting it twice, so every band starts a day off.
  • Reading Maersk’s “Day 5 to 8” as the fifth to eighth day after free time, when it is the fifth to eighth day of the clock.
  • Pricing every charged day at the top band’s rate.
  • Using today’s tariff for an old move: Maersk applies the free time and rates in force on the origin price calculation date.

Published detention tariffs compared

The calculator’s three preset tariffs are Hapag-Lloyd’s USA import merchant-haulage table of 1 October 2025, Maersk’s US Import Detention tariff of 20 June 2026 and Maersk’s South China combined demurrage and detention table of 1 June 2025, as each carrier publishes them. A rate is per container per day; “free” days include day 1.

TariffEquipmentFree daysBand 1Band 2Band 3, thereafter
Hapag-Lloyd USA import merchant haulage, excl. California, 1 Oct 2025Regular, 20 ft to 45 ft5 (DOI + 4 WD)3 days, USD 2003 days, USD 250USD 300
Hapag-Lloyd, sameSpecial4 (DOI + 3 WD)3 days, USD 3003 days, USD 425USD 475
Hapag-Lloyd, sameOperating reefer4 (DOI + 3 WD)3 days, USD 4753 days, USD 600USD 675
Maersk US import detention, 20 Jun 2026Dry and non-operating reefer4 working daysdays 5 to 8, USD 210days 9 to 12, USD 260USD 290
Maersk, sameOperating reefer3days 4 to 6, USD 430days 7 to 10, USD 535USD 585
Maersk, sameSpecial equipment3days 4 to 6, USD 360noneday 7 on, USD 465
Maersk South China combined D&D, 1 Jun 202520 ft dry7 calendardays 8 to 12, RMB 200days 13 to 20, RMB 250RMB 375
Maersk South China, same40 ft dry or high cube7 calendardays 8 to 12, RMB 350days 13 to 20, RMB 450RMB 675
Maersk South China, same40 ft reefer4 calendardays 5 to 10, RMB 606days 11 to 20, RMB 909RMB 1,818

Both US tariffs charge one rate for every size of dry box; only the South China table prices a 40 ft box above a 20 ft one, at RMB 350 against RMB 200 in the first band.

15101520253002,0004,0006,0008,000days out, from a MondayUSD a containerHapag-Lloyd: USD 7,050 at 30 daysHapag-LloydUSD 7,050Maersk US: USD 7,100 at 30 daysMaersk USUSD 7,100
Detention on one 40 ft dry container out on a Monday, by days out, under the two US tariffs. Maersk’s free time ends a day sooner, on day 4, and its first rate is USD 10 higher; Hapag-Lloyd’s top rate is USD 10 higher and starts sooner, on day 12 against day 13. At 30 days out the two are USD 50 apart: USD 7,050 and USD 7,100.

Maersk’s South China rates in the table are combined demurrage and detention: one clock runs from the discharge day to the day the empty is gated in, so the free days are spent in the terminal and outside it alike.

Demurrage, detention, per diem and port storage

The carriers draw the line by where the container is. Maersk’s US import page charges demurrage for “use of the land and equipment” at the port or container yard beyond free time, and detention for “the use of the equipment beyond allowed free time”, once the box has left. Port storage is a terminal’s own charge, billed separately in Maersk’s South China tariff, and some carriers call the outside charge per diem.

US regulation does not split them. 46 CFR 541.3 defines “demurrage or detention” as one term: any charge, “including per diem”, for the use of terminal space or of shipping containers, freight excluded. A carrier’s labels therefore do not change which billing rules apply in the US.

Container demurrage is a different charge from the demurrage on a voyage charter, which pays the shipowner for the ship’s time once laytime has run out; the laytime and demurrage calculator works that one out.

What a US detention invoice must show

46 CFR 541.6 lists the minimum contents, and 541.5 says an invoice missing any of it need not be paid:

  • The bill of lading and container numbers, for imports the port of discharge, and the basis on which the billed party is the right party to pay.
  • The invoice date and due date; the free time in days with its start and end dates; the container availability date for imports or the earliest return date for exports; and the dates charged.
  • The total, the tariff rule or service contract section behind the daily rate, and the rate itself.
  • A contact for mitigation, refund or waiver requests, a URL or QR code for the documents needed, and the dispute timeframes.
  • Two certifications: that the charges comply with the Commission’s rules, 545.5 included, and that the billing party’s own performance did not cause or contribute to them.

The invoice must be issued within 30 calendar days of the date the charge was last incurred (541.7(a)), and the billed party gets at least 30 calendar days from the invoice date to dispute it (541.8(a)). Maersk’s US page allows 60 days from the invoice date. The rule on who may be billed, 541.4, was set aside by the D.C. Circuit in World Shipping Council v. FMC and removed with effect from 29 December 2025 (90 FR 60579); the rest of Part 541 stands.

Where to find each input

The gate-out date is on the terminal’s interchange receipt (the equipment interchange receipt) or the trucker’s gate ticket, and the return date on the gate-in receipt of the depot the carrier named. The free days and bands come from the service contract where one covers the shipment; otherwise from the carrier’s detention tariff for the country and the move type, merchant or carrier haulage. Hapag-Lloyd publishes a separate table for each. A US invoice must print the free time and the dates charged under 541.6(b), so a figure on the invoice can be checked against the one here line by line.

Regulatory basis

The carrier’s tariff or the service contract sets the free time and the rates; in the United States the Federal Maritime Commission regulates how they are billed and judges whether a practice is reasonable.1,2

Definition
Demurrage or detention, per diem included, one term, 46 CFR 541.31
Invoice contents
46 CFR 541.6 (a) to (e); an invoice missing any item need not be paid, 541.5 and 46 U.S.C. 41104(f)1,5
Issue deadline
30 calendar days from the date the charge was last incurred, 46 CFR 541.7(a)1
Dispute window
At least 30 calendar days from the invoice date, 46 CFR 541.8(a); the billing party tries to resolve within 30 days, 541.8(b)1
In force
28 May 2024, final rule 89 FR 14330 under the Ocean Shipping Reform Act of 20223
Who may be billed
46 CFR 541.4 set aside by the D.C. Circuit and removed from 29 December 2025, 90 FR 60579; the rest of Part 541 stands4
Reasonableness
Incentive to move cargo, 46 CFR 545.5(c)(1); detention when empties cannot be returned likely unreasonable, 545.5(c)(2)(ii)2
Tariffs used
Hapag-Lloyd USA Detention, 1 October 2025; Maersk US Import Detention, 20 June 2026; Maersk South China combined D&D, 1 June 20256,9,10

What the detention count leaves out

  • Holidays and closures by date. The calculator takes Monday to Friday, Monday to Saturday or every day as working days, and a count of closed days that extends the free time; it does not hold any port’s holiday calendar. Hapag-Lloyd charges bank holidays after free time but not unscheduled shutout days.7
  • Working-day charging. Hapag-Lloyd’s California tables charge per working day after free time; the calculator charges calendar days, as the other tables do.6
  • Weekend terminals. The Hapag-Lloyd preset counts Monday to Friday as working days; its tariff also counts a Saturday or Sunday as a working day at a terminal open that day. For such a terminal pick Your own tariff with Monday to Saturday or every day.6
  • Who issued the invoice. The 30-day deadline in 46 CFR 541.7(a) binds the carrier or terminal; an NVOCC passing the charge on has 30 days from the date of the invoice it received, 541.7(b), and a re-issued invoice runs from the original under 541.7(d).1
  • Clock stops. A customs hold that is not the merchant’s fault restarts Hapag-Lloyd’s free time from the day after release; enter the day after release as the gate-out date.7
  • Tariff version and contracts. A service contract’s free time and rates override the tariff, and Maersk applies the tariff in force on the origin price calculation date; pick Your own tariff to enter either.9
  • Separate demurrage. In the US the demurrage clock inside the terminal runs separately from detention, under its own tariff; this calculator prices one clock at a time.8
  • Whether a charge is reasonable or the invoice complete. The calculator gives the arithmetic and the 541.7 deadline, not a ruling under 46 CFR 545.5 or 541.6.1,2

Frequently Asked Questions (FAQs)

How are container detention charges calculated?

Count the free days from the day the container leaves the terminal, then charge every calendar day from the next day to the return day at the rate of the tariff band that day falls in, and multiply by the number of containers. Under Hapag-Lloyd's USA import merchant-haulage tariff of 1 October 2025, outside California, a dry box out 18 days past free time costs 3 × USD 200 + 3 × USD 250 + 12 × USD 300, USD 4,950.

What is the difference between demurrage and detention?

In carrier tariffs, demurrage is charged while a full container stays in the terminal or carrier's yard beyond free time, and detention while the carrier's container is outside it, with the merchant, beyond free time. Maersk's US import page defines them that way. The US Federal Maritime Commission treats both as one term in 46 CFR 541.3, covering per diem too.

Does the day of pickup count as a free day?

Yes, under Hapag-Lloyd's USA Detention tariff of 1 October 2025 and Maersk's US Import Detention tariff of 20 June 2026. Hapag-Lloyd writes free time as DOI + 4 WD, the day of interchange plus four working days, and Maersk's US free time commences on the day the equipment leaves the carrier's container yard. Maersk's South China tariff counts from the discharge day, included.

Are detention free days working days or calendar days?

Under Hapag-Lloyd's USA Detention tariff of 1 October 2025 and Maersk's US Import Detention tariff of 20 June 2026, free time is counted in working days and the charge in calendar days. Hapag-Lloyd defines a working day as a day the terminal is open for interchange; Maersk counts Monday to Saturday when a gate is open. Maersk's South China combined tariff counts calendar days throughout.

How long does a carrier have to send a detention invoice in the US?

30 calendar days from the date the charge was last incurred, under 46 CFR 541.7(a). An invoice issued later does not have to be paid. The billed party then has at least 30 calendar days from the invoice date to ask for mitigation, refund or waiver, under 541.8(a).

What must a US detention invoice show?

46 CFR 541.6 requires, among other items, the bill of lading and container numbers, the invoice and due dates, the free time in days with its start and end dates, the dates charged, the tariff rule or service contract and the rate, the total, a dispute contact, and two certifications. Under 541.5, an invoice missing any of it need not be paid.

Can a carrier charge detention when the empty container cannot be returned?

The FMC's interpretive rule, 46 CFR 545.5(c)(2)(ii), says that, absent extenuating circumstances, detention charged when it does not serve its incentive purpose, such as when empty containers cannot be returned, is likely to be found unreasonable. Hapag-Lloyd's US guide of May 2026 excludes unscheduled terminal shutout days from charges.

How to use this calculator

  1. Pick the tariff: one of the three published carrier tariffs, or Your own tariff to type the free days, the day bands and the rates from your service contract or the carrier's current tariff.
  2. Pick the container size and type: dry, special equipment such as a flat rack or open top, or an operating reefer.
  3. Enter the date the container left the terminal or depot (the day of interchange) and the date it was returned, as on the gate-out and gate-in receipts.
  4. Enter the number of containers that moved on the same dates under the same tariff, and any days inside the free time when the terminal was closed.
  5. Read the last free day, the days charged in each band, the charge per container and the total. For a US move, enter the invoice date to check it was issued within 30 days of the return under 46 CFR 541.7.

Test cases this calculator passes

Every build of this site runs these cases through the calculator above and stops the release if any figure moves outside its tolerance. Load a case to put its inputs into the calculator.

InputsExpected resultTraced toLoad
Hapag-Lloyd US import, 40 ft dry, out Mon 2 Mar 2026, back Tue 24 Mar 2026, 5 containersTotal: USD 24,750Shows “USD 4,950 a container”Free time end: Fri 6 MarShows “18 days charged”Shows “23 days on the clock”Invoice due by: Thu 23 AprHapag-Lloyd USA Detention tariff, effective 1 Oct 2025, USA excl. California, Import Merchant Haulage: free DOI+4WD (Regular) or DOI+3WD (Special, Reefer); 1st period 3 CD, 2nd period 3 CD, thereafter: free Mon 2 (DOI) + Tue 3 to Fri 6; charged Sat 7 to Tue 24 Mar = 18 CD; 3 × 200 + 3 × 250 + 12 × 300 = 4,950; × 5 = 24,750. Invoice within 30 calendar days of 24 Mar, 46 CFR 541.7(a).Load inputs
Same box returned Thu 5 Mar 2026Total: USD 0Shows “no detention is due”Hapag-Lloyd USA Detention tariff, effective 1 Oct 2025, USA excl. California, Import Merchant Haulage: free DOI+4WD (Regular) or DOI+3WD (Special, Reefer); 1st period 3 CD, 2nd period 3 CD, thereafter: returned before the last free day, Fri 6 Mar.Load inputs
Same box returned Fri 6 Mar 2026, the last free dayTotal: USD 0Free time end: Fri 6 MarShows “no detention is due”Hapag-Lloyd USA Detention tariff, effective 1 Oct 2025, USA excl. California, Import Merchant Haulage: free DOI+4WD (Regular) or DOI+3WD (Special, Reefer); 1st period 3 CD, 2nd period 3 CD, thereafter: DOI + 4 WD ends Fri 6 Mar; nothing charged.Load inputs
Same box returned Sat 7 Mar 2026Total: USD 200Shows “1 day charged”Hapag-Lloyd USA Detention tariff, effective 1 Oct 2025, USA excl. California, Import Merchant Haulage: free DOI+4WD (Regular) or DOI+3WD (Special, Reefer); 1st period 3 CD, 2nd period 3 CD, thereafter: Sat 7 Mar is the first calendar day after free time, 1 × USD 200.Load inputs
Out Thu 5 Mar 2026, back Fri 13 Mar 2026, 1 containerFree time end: Wed 11 MarShows “2 days charged”Total: USD 400Hapag-Lloyd USA Detention tariff, effective 1 Oct 2025, USA excl. California, Import Merchant Haulage: free DOI+4WD (Regular) or DOI+3WD (Special, Reefer); 1st period 3 CD, 2nd period 3 CD, thereafter: free Thu 5 (DOI), Fri 6, Mon 9, Tue 10, Wed 11; Sat 7 and Sun 8 not working days; charged Thu 12 and Fri 13, 2 × 200.Load inputs
The other 8 test cases
InputsExpected resultTraced toLoad
Maersk US import detention, dry, same dates, 5 containersFree time end: Thu 5 MarShows “19 days charged”Shows “USD 5,070 a container”Total: USD 25,350Maersk US Import Detention, effective 20 Jun 2026: Day 1 to 4 free on a working-day basis, Monday to Saturday; Day 5 to 8 USD 210, 9 to 12 USD 260, 13+ USD 290, per calendar day. 4 × 210 + 4 × 260 + 11 × 290 = 5,070.Load inputs
Maersk South China combined D&D, 20 ft dry, discharge Mon 1 Jun 2026, empty in Thu 25 Jun 2026Free time end: Sun 7 JunShows “18 days charged”Total: RMB 4,875Maersk South China (PRC mainland) Import Combined D&D, effective 1 Jun 2025, discharge day and gate-in empty day included: 1-7 free, 8-12 RMB 200, 13-20 RMB 250, 21+ RMB 375; 5 × 200 + 8 × 250 + 5 × 375 = 4,875.Load inputs
Hapag-Lloyd operating reefer, 2 closed days in free time, default datesFree time end: Mon 9 MarShows “15 days charged”Shows “USD 9,300 a container”Hapag-Lloyd USA Detention tariff, effective 1 Oct 2025, USA excl. California, Import Merchant Haulage: free DOI+4WD (Regular) or DOI+3WD (Special, Reefer); 1st period 3 CD, 2nd period 3 CD, thereafter; Hapag-Lloyd US D&D guide May 2026, section G: a shutout day inside free time extends it. DOI + 3 WD + 2 = Mon 9 Mar; 3 × 475 + 3 × 600 + 9 × 675 = 9,300.Load inputs
Default, invoice dated Sun 3 May 2026Invoice due by: Thu 23 AprShows “need not be paid”46 CFR 541.7(a): a demurrage or detention invoice issued more than 30 calendar days after the charge was last incurred (24 Mar 2026) need not be paid.Load inputs
Maersk US special equipment, 1 container, out Mon 2 Mar 2026, back Tue 31 Mar 2026Free time end: Wed 4 MarShows “27 days charged”Total: USD 12,240Third band: noneMaersk US Import Detention tariff, effective 20 Jun 2026, special equipment: Day 1 to 3 free (Mon to Sat), Day 4 to 6 USD 360, Day 7+ USD 465: free Mon 2 to Wed 4 Mar; charged Thu 5 to Tue 31 Mar = 27 CD; 3 × 360 + 24 × 465 = 12,240.Load inputs
Maersk South China 40 ft operating reefer, out 1 Jun 2026, back 25 Jun 2026Free time end: Thu 4 JunShows “21 days charged”Total: RMB 21,816Maersk South China (PRC mainland) Import Combined D&D, effective 1 Jun 2025, 40' reefer: 1 to 4 free, 5 to 10 RMB 606, 11 to 20 RMB 909, 21+ RMB 1,818, calendar days: charged 5 to 25 Jun = 21 days; 6 × 606 + 10 × 909 + 5 × 1,818 = 21,816.Load inputs
Hapag-Lloyd US special equipment in a 45 ft boxShows “prints no 45 ft special equipment rate”Hapag-Lloyd USA Detention tariff, effective 1 Oct 2025: Special and Reefer rates are printed for 20 ft and 40 ft equipment only.Load inputs
Return date before the gate-out dateShows “The return date is before the gate-out date”Input check: the clock cannot end before it starts.Load inputs

Change log

Each change to the method, a coefficient or a test case, with the date it reached this page.

  • First published, with test cases for the Hapag-Lloyd default, a return inside free time and on the last free day, a gate-out before a weekend, the Maersk US and South China tariffs, a closed day in free time, a US invoice issued late and a return date before the gate-out.

Who publishes this calculator and how it is checked

Publisher
ShipCalculators.com, an independent site of maritime calculators.
How it is checked
Each figure is traced to the instrument that sets it, and the test cases on this page run against the calculator code on every build; a build that moves one of them does not deploy. Last method check: 18 October 2026.
What it is not
Not an invoice or a dispute decision: the tariff or service contract in force for the shipment, and the terminal's own calendar of working days, decide the figure of record.

Calculators used with this one

Container demurrage is not the demurrage on a voyage charter, which the laytime and demurrage calculator works out from the laytime allowed and used.

Before the box goes out, the pallets per container calculator counts how many pallets each box takes, which sets the number of containers a shipment needs and so the multiplier in the detention charge.

Regulation and sources

  1. 46 CFR Part 541, Demurrage and Detention Billing Requirements, sections 541.3 and 541.5 to 541.8 (eCFR)
  2. 46 CFR 545.5, Interpretive rule on demurrage and detention under the Shipping Act (eCFR)
  3. Federal Maritime Commission, Demurrage and Detention Billing Requirements, final rule, 89 FR 14330, 26 February 2024
  4. Federal Maritime Commission, Properly issued invoices provision set aside by court, 90 FR 60579, 29 December 2025
  5. 46 U.S.C. 41104, as amended by the Ocean Shipping Reform Act of 2022 (govinfo)
  6. Hapag-Lloyd, USA Detention tariff, effective 1 October 2025
  7. Hapag-Lloyd, Detention and Demurrage Tariff Guide for the United States, May 2026
  8. Maersk, United States import: demurrage, detention and free time
  9. Maersk, US Import Detention tariff, effective 20 June 2026
  10. Maersk, South China including Hong Kong, Import Combined Detention and Demurrage, effective 1 June 2025