There are about 7-1/2 gallons in a cubic foot. So, if you convert your dimensions to feet, multiply them, and then multiply that cubic foot volume by 7.5, you will be pretty close.
Easiest way is to multiply in inches.. LxWxH and divide by 231 (one gallon takes up 231 cubic inches)
For example a 2' cube would be 24x24x24=13824......13824/231= 59.84 gallons (be sure to subtract glass thickness)