Demurrage is the charge you pay when cargo operations exceed the agreed free time: a vessel held at berth beyond laytime in bulk chartering, or a container sitting in the terminal past its free days in liner shipping. Detention is the charge for holding the carrier's equipment outside the terminal, typically a container that left the port but was not returned empty on time. Same family of penalty, different clock, different location.
The two get confused constantly because both are billed by carriers, both are quoted per day, and both escalate in tiers that get punishing fast. But if you work a commodity desk, the distinction matters: demurrage exposure lives in your charterparty and terminal operations, while detention exposure lives in your inland logistics and empty-return discipline.

