How do the dice loot chests work?

Solution 1:

If you open the chest normally, 1d20 will be rolled. The chest will give the following based on the result of this roll:

  • 1: 1 Eridium, live grenade
  • 2-3: White (common) items
  • 4-14: Green (uncommon) items
  • 15-18: Blue (rare) items
  • 19: One blue and one purple (epic) item (a rocket launcher will be purple rarity)
  • 20: Purple or E-tech items

If you spend 5 Eridium, 2d20 will be rolled and the higher of the two dice will be taken as the result for determining loot quality (i.e. rolling with advantage in D&D 5e). In addition to the above, the following special cases apply:

  • 1 on both dice: 4 Eridium, three live grenades
  • 20 on both dice: Orange (legendary) item; possibly a pearlescent item if in UVHM

Source: Borderlands Wiki

Solution 2:

The higher the roll, the better chance at a rarer item. There are no set breakpoints for which roll give which rarity tier, just higher chances. By spending 5 Iridium, you can roll both dice with only the higher die counting.