# Demurrage and Detention Cost Calculator for Ocean Containers

> Source: https://netray.co/tools/demurrage-detention-cost-calculator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Model terminal demurrage and equipment detention using free days and tiered daily rates per container.

## Category

supply-chain

## Audience

- Logistics coordinator
- Import manager
- Customs broker
- Freight forwarder

## Tool

**Kind:** calculator

**Inputs:**

#### Number of containers

**Key:** containers

**Type:** number

**Default:** 4

**Min:** 1

**Step:** 1

#### Days in terminal after discharge

**Key:** days_terminal

**Type:** number

**Default:** 12

**Min:** 0

**Step:** 1

**Unit:** days

**Help:** Calendar days from discharge to gate out, unless the tariff counts working days.

#### Demurrage free days

**Key:** free_days

**Type:** number

**Default:** 4

**Min:** 0

**Step:** 1

**Unit:** days

#### Tier 1 length

**Key:** tier1_days

**Type:** number

**Default:** 5

**Min:** 0

**Step:** 1

**Unit:** days

#### Tier 1 rate

**Key:** rate1

**Type:** number

**Default:** 150

**Min:** 0

**Step:** 5

**Unit:** $/day

#### Tier 2 length

**Key:** tier2_days

**Type:** number

**Default:** 5

**Min:** 0

**Step:** 1

**Unit:** days

#### Tier 2 rate

**Key:** rate2

**Type:** number

**Default:** 250

**Min:** 0

**Step:** 5

**Unit:** $/day

#### Tier 3 rate (after tier 2)

**Key:** rate3

**Type:** number

**Default:** 350

**Min:** 0

**Step:** 5

**Unit:** $/day

#### Days container held outside terminal

**Key:** days_out

**Type:** number

**Default:** 8

**Min:** 0

**Step:** 1

**Unit:** days

**Help:** From gate out to empty return.

#### Detention free days

**Key:** det_free

**Type:** number

**Default:** 5

**Min:** 0

**Step:** 1

**Unit:** days

#### Detention rate

**Key:** det_rate

**Type:** number

**Default:** 120

**Min:** 0

**Step:** 5

**Unit:** $/day

**Outputs:**

#### Chargeable demurrage days

**Key:** chargeable

**Expr:** max(0, days_terminal - free_days)

**Format:** integer

#### Days in tier 1

**Key:** t1

**Expr:** min(chargeable, tier1_days)

**Format:** integer

#### Days in tier 2

**Key:** t2

**Expr:** min(max(chargeable - tier1_days, 0), tier2_days)

**Format:** integer

#### Days in tier 3

**Key:** t3

**Expr:** max(chargeable - tier1_days - tier2_days, 0)

**Format:** integer

#### Demurrage per container

**Key:** dem_per

**Expr:** t1 * rate1 + t2 * rate2 + t3 * rate3

**Format:** currency

#### Detention per container

**Key:** det_per

**Expr:** max(0, days_out - det_free) * det_rate

**Format:** currency

#### Total D&D for all containers

**Key:** total_cost

**Expr:** (dem_per + det_per) * containers

**Format:** currency

**Primary:** true

#### Average cost per container per day held

**Key:** per_day

**Expr:** (dem_per + det_per) / max(1, days_terminal + days_out)

**Format:** currency

**Primary:** true

**Chart:**

#### Total D&D vs days in terminal

**Type:** line

**X:** days_terminal

**From:** 0

**To:** 30

**Steps:** 16

**Series:**

- total_cost

**Disclaimer:** Illustrative tiers only. Use the actual tariff or service contract of your ocean carrier, which sets free time, tier breakpoints, whether weekends count and the equipment type. Rates are not published here.

## Content

**Intro:** Demurrage and detention are the per diem charges carriers bill when a container stays too long at the terminal or outside it. This calculator lets you test free days, tier breakpoints and clearance delay so you can see what a late release really costs.

**Sections:**

#### Demurrage versus detention

**Body:** Demurrage is charged for a loaded container sitting inside the port or terminal beyond free time. Detention is charged for equipment held outside the terminal, for example at your warehouse, beyond its free time until the empty is returned. Some carriers combine them into a merged day count. Always check how your contract defines the start and stop events, such as discharge, availability, gate out and empty return.

#### How to use it

**Body:** Enter the number of containers, days at the terminal and days held outside, then fill in free days and tier rates from your tariff. The calculator counts only days beyond free time, splits them across the tiers and adds detention. Use the chart to see how fast the total climbs when customs release slips. Escalating tiers mean the tenth day usually costs far more than the fifth.

**Bullets:**

- Obtain the tariff in writing before arrival
- Confirm whether weekends and holidays count
- Track the start event, not just the vessel ETA

#### Worked example

**Body:** Four containers sit 12 days, with 4 free. That leaves 8 chargeable days: 5 in tier 1 at 150 and 3 in tier 2 at 250, which is 1,500 per container. Detention is 8 days out with 5 free, so 3 days at 120, or 360. Per container the cost is 1,860, and for four containers the total is 7,440. Clearing three days earlier would remove the whole tier 2 amount.

#### Common mistakes

**Body:** Counting days from the vessel ETA instead of the discharge or availability date, ignoring a free-time extension agreement, and treating detention as optional are frequent errors. Failing to log gate-out and return dates makes disputes hard to win. Record container numbers, dates and invoice references in your ERP or TMS so charges can be matched to cause, and so late-arriving documents are traced to the supplier or broker.

**Cta:** If D&D invoices are checked by hand against emails, Netray can help match container events to invoices and flag disputable charges before they are paid.

**Faq:**

#### Who pays demurrage and detention?

**Answer:** Normally the party named as merchant or consignee in the carrier's bill of lading terms is liable, which can be the importer even when a broker or forwarder causes the delay. Your commercial contract and Incoterm decide who should bear the cost between buyer and seller, so settle that before shipping.

#### Can demurrage be disputed?

**Answer:** Often, yes. Common grounds are terminal closures, missing carrier release, equipment unavailable for pickup, or free time not applied correctly. Regulators in some countries set billing rules for these charges. Keep timestamps and emails, and raise the dispute with the carrier within the period stated in its tariff.

#### Do weekends count as free days?

**Answer:** It depends on the tariff. Some carriers count calendar days, others exclude weekends and holidays at the terminal. This tool counts days exactly as you enter them, so convert working days to the day count your contract uses before you enter the figure.

#### How can I reduce demurrage and detention?

**Answer:** Pre-clear customs before arrival, send documents early, book trucks ahead, negotiate longer free time for the lane, and choose a terminal or drayage partner with return slots. Review lanes that repeatedly exceed free time and fix the root cause, which is often document timing.

## Search terms

demurrage and detention calculator, demurrage calculator, detention charges calculator, container demurrage cost, D&D charges explained, per diem container calculator, demurrage vs detention, container free days

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
