The usual tariff is based on a concept called "weight-measure", which works like this:
- For cargo less dense than water, a given tariff is per cubic meter.
- For cargo denser than water, the tariff is per metric ton (one cubic meter of water weighs one metric ton).
If you think about it, this makes perfect sense, because anything heavier than denser than water has to be accompanied by enough air (i.e. empty space inside or outside the container) to make the average density of the shipment equal one, and anything lighter than water takes up just as much space in the ship as heavier cargo would. The result is that if you have e.g. a 2000 TEU ship, and each TEU is 35 cubic meters, a full ship will always generate 70,000 tariff units, whether it be laden with cotton candy or iron pellets.
Of course, shipping companies play both ends against the middle and can, with optimization, get better than 100% billing (e.g. by using fluffy stuff like household goods to provide the airspace needed to compensate for containers full of car engines).
In a previous incarnation I was a Systems Designer at a major container shipping company.