& Key message In a tropical rainforest of Madagascar, tree species differed in average wood density depending on their light requirements and on the soil type. Tree diameter had no effect. None of these factors influenced the variation of density related to the distance to the pith. & Context Wood density (WD) is an important wood property as it correlates with several functional tree traits and mechanical wood properties. Furthermore, wood density is often used in forest biomass and carbon stock estimates. The variation in wood density depends on a range of intrinsic or environmental factors. & Aims This study investigated the effect of species, tree diameter, soil types and the distance from the pith on wood density in native hardwood species from a natural, midelevation rainforest in Madagascar. & Methods We extracted pith-to-bark core samples from the trunk of 204 trees from 23 species. Each wood core was sectioned into 1 cm-long segments on which measures of volume and weight were performed. Within-tree and between-tree variations of wood density were analysed. & Results Average wood density was higher on shade-tolerant than on light-demanding species. It was higher on poor ferralitic than on fertile lowland soils. Tree diameter had no influence on average wood density. Regarding within-tree variation, wood density does not vary from pith to bark. & Conclusion These results help fill the gaps in wood properties database for tree forest species in Madagascar.