Despite their economic importance, the ecology of many sea cucumber species is poorly understood and factors influencing their habitat preferences remain largely unexplained. The distribution and habitat preference of two sea cucumber species; Holothuria atra and Holothuria edulis were studied off the north-west coast of Sri Lanka by underwater visual census in October 2008. The relationships between the density of each species and the habitat variables, such as mean grain size, organic content (% of dry weight), gravel (%), silt–mud (%), and depth, were examined using a generalized additive model. All these variables except silt–mud have significant influence (P < 0.05) on the habitat association of H. atra. The shallow water (<10 m) seagrass habitat with sediments characterized by 2–3.5% organic content, 15–25% of gravel and coarse sand (0.7–1.2 mm) were the most preferred conditions by H. atra. High densities of H. edulis were found in the shallow (<10 m) depths of rocky areas with algae and seagrass. Favoured bottom sediment conditions of H. edulis were mainly similar to the conditions preferred by H. atra, except organic content which did not significantly influence the habitat preference of this species. The preference towards the specific habitat characteristics seems to be associated with their feeding and protection. An understanding of habitat preference would be useful to improve the management of these sea cucumber populations and enable more precise stock assessment.