Volume comes from area and depth
For a rectangular base, length × width × average depth gives cubic centimetres. Divide by 1,000 for litres. A 90 × 35 cm base at 5 cm average depth needs about 15.75 litres.
Calculate the physical volume first, then translate that into bags for the specific product.

For a rectangular base, length × width × average depth gives cubic centimetres. Divide by 1,000 for litres. A 90 × 35 cm base at 5 cm average depth needs about 15.75 litres.
Sand, gravel and porous planted substrates have different bulk densities. Use the bag’s coverage or density information when available rather than assuming every litre weighs the same.

Original diagram supporting the how much aquarium substrate do you need? explanation.
If the bed rises evenly from 3 cm at the front to 7 cm at the back, 5 cm is a reasonable first average. Complex mounds need a more tailored estimate.
Large rocks that sit directly on the aquarium base reduce the footprint that needs substrate. Subtracting their rough base area can improve an order estimate.
The calculator can price a chosen depth but cannot choose the correct depth for burrowing animals, rooted plants or a specific aquascape. Research those needs separately.
Geometry gives you substrate volume. The bag or manufacturer specification tells you how that volume translates to kilograms or bags for the material you actually intend to buy. That is more reliable than assuming every gravel, sand and aquasoil has the same density.