Objects float if they are less dense than the fluid they are in, while objects sink if they are more dense. Density depends on an object's mass and volume. Ships and submarines are able to control whether they float or sink by changing their overall density, either by changing their mass through adjusting ballast, or changing their volume. Archimedes' principle explains that the buoyant force on an object equals the weight of the fluid it displaces.