Density vs dimensional weight
Both convert size into money, but they belong to different shipping modes and are calculated differently. Using the wrong one produces a number nobody will recognise.
Density is for palletised LTL
Density is weight divided by volume, expressed in pounds per cubic foot. It maps onto the eighteen freight classes and applies to less-than-truckload freight moving on pallets inside North America.
Dimensional weight is for parcel
Dimensional weight converts volume into a weight figure by dividing cubic inches by a divisor set by the carrier. You are then billed on whichever is greater, that figure or the actual weight. It applies to small packages, not pallets.
The practical test
If it moves on a pallet and needs a bill of lading, you need density and a freight class. If it goes in a van with a tracking barcode on the box, you need dimensional weight.
Where people get confused
Some shipments are near the boundary between the two modes, and a broker may quote both. Ask which mode the quote assumes before comparing prices, because the two numbers are not comparable on their own.
Both calculations are here: freight class by density and dimensional weight.