Disclosure: I'm sharing a tool from Room & Root, the website I run. The calculations are free to use and don't require an account. We intend to support the site with advertising.
If you're planning a garden bed, the quantity estimate starts with the area and your chosen depth. For example, a rectangular bed 3 m long and 1.2 m wide, filled to 20 cm, has a geometric volume of:
3 × 1.2 × 0.20 = 0.72 cubic metres, or 720 litres.
At 50 litres per bag, that is 14.4 bags, rounded up to 15. If you choose to add a 10% allowance, the estimate becomes 792 litres and 16 bags. The allowance is an example, not a rule for every material or bed.
Room & Root's soil and mulch calculator lets you combine rectangular or circular beds, adjust depth and allowance, and compare bag quantities with bulk volume. You can print or copy the resulting shopping list:
https://roomnroot.com/soil-mulch-calculator/
The calculation estimates the volume you enter. It doesn't choose a soil blend, prescribe mulch depth, or predict settling. Those depend on the bed, plants and material. For an irregular bed, you can split the shape into simpler sections and check the combined estimate.
I hope it is useful when planning a bed or comparing bagged and bulk supplies.