Its typical habitat is woodlands, shrublands, grasslands, and mangroves. This species is adaptable to a wide range of terrain including grassland plains, jungle, open fields and even heavily populated regions. As an adaptable species, it occurs in a wide variety of habitats across its range. It can be found in rice paddy fields in maritime lowlands to various types of montaine forests, though it avoids dark forest with closed canopy. In primary monsoon season and rain forests, "Naja atra" inhabits clearings and riverbanks. Higher population density is observed in the vicinity of human settlements, in secondary forests, and in rice paddy fields which are adjacent to forests. The species can be found anywhere from sea level all the way up to elevations of more than above sea level. It usually hides under leaves, sticks, and rocks.