It is from cubic inches (multiplying the length, depth and height of the tank) and then it depends on where you are.
As a rough guide, I seem to recall divide by 233 for US gallons or 276 for imp gallons.
Otherwise just use one of the many conversion websites out there such as google (google: "xci in gallons")
I was close enough for a unit of measurement used by such a small minority of the world's populationYou divide by 231 for US gallons.
@Andy . LOLused by such a small minority of the world's population