Calculate volume first
The physical quantity is driven by the base area and average depth. A 90 × 35 cm footprint with an average 5 cm bed requires about 15.75 litres of material before you adjust for rocks or uneven coverage.
Work from tank footprint and average depth, then convert volume to an approximate product weight.

The physical quantity is driven by the base area and average depth. A 90 × 35 cm footprint with an average 5 cm bed requires about 15.75 litres of material before you adjust for rocks or uneven coverage.
Sand, fine gravel, coarse gravel and porous planted-tank substrates have different bulk densities. Ten kilograms of one product does not necessarily cover the same area as ten kilograms of another. Use the manufacturer’s coverage figure when it is available.

For a sloping bed, use an average depth as a first planning estimate and then allow for hardscape that displaces substrate.
A bed that slopes from 3 cm at the front to 7 cm at the back has an average depth of roughly 5 cm if the slope is reasonably even. Large rocks resting directly on the base reduce the area that needs substrate.
The calculator tells you how much material a chosen depth requires. It does not choose the correct substrate or depth for a specific fish, plant or aquascape. Burrowing fish and rooted plants can have very different needs.
The geometric part is straightforward: footprint × average depth gives substrate volume. Weight is less universal because aquarium sand, natural gravel, crushed coral and porous planted-tank soils have different bulk densities. Use the product's own coverage or density information when it is available.
If you are planning a slope, use an average depth for the first estimate. For example, a bed that rises evenly from 3 cm at the front to 7 cm at the back averages about 5 cm before allowing for rocks or other areas that replace substrate.