In the wild, corn snakes seek out areas where there is plenty of cover. They prefer wooded areas, especially mature upland pine forests on sand or loam soils, although they are also found in oakwoods. There is usually a water source such as a stream or pond nearby. Ever adaptable though, Florida Keys populations also occur in mangrove forests.
Studies have shown corn snakes spend over half their time hidden away in underground hides, such as fissures in rocks and rodent burrows. They also spend long periods concealed beneath surface objects such as leaf litter and rotten bark. This is especially true of young corn snakes, which frequent the more sunny aspects of the landscape, as does their prey, typically consisting of skinks and anoles at this early stage, although corn snakes in Florida continue hunting smaller reptiles of this type throughout their lives.