20 gallons is pretty generic. There are 20 gallon longs, 20 gallon talls, etc.
The actual size is more important than the number of gallons a tank holds.
The general rule of thumb is, the tank should measure so that 1 long side plus 1 short side is the length of the snake.
So if you expect your snake to one day be 5 feet long, then your tank should measure something like 4 feet x 1 foot, or 3 feet x 2 feet, or 2-1/2 feet x 2-1/2 feet.
There are folks that will say "A 20 gallon tank is all you need for a corn snake." But that really doesn't tell you anything.
And although it might hold the snake, there is not nearly enough room for the snake to stretch out and move about.
Also corn snakes like to climb, so a taller tank (16 inches or more) is generally recommended.
I might be able to sleep on a 3 foot wide bed in a 6 foot by 4 foot prison cell, but I really like my king sized bed in my 18 foot by 13 foot bed room.
Just because it's a snake doesn't mean it has to be crammed into a tight little space. They don't live like that in the wild.