Oil palm cultivation is expanding rapidly into many of the world’s most biodiverse tropical regions. One of the most functionally important and ecologically dominant animal groups in these environments is the ants. Here, we quantify the overall impacts of clear-felling lowland dipterocarp rainforest and conversion into oil palm plantation on ant diversity. At study sites in Sabah, Malaysia we collected ants from three microhabitats: 1 – the canopy, 2 – bird’s nest ferns (Asplenium nidus complex, a common epiphyte in forest and oil palm), and 3 – leaf litter. We also measured temperature, humidity and light at collection sites to assess their impacts on ant community composition. Total ant species richness decreased from 309 to 110 (−64%) between forest and oil palm plantation. However, this impact was not the same across all microhabitats, with bird’s nest ferns maintaining almost the same number of ant species in oil palm compared to forest (forest-oil palm, ferns: 36–35 (3% loss), canopy: 120–58 (52% loss), leaf litter: 216–56 (74% loss)). Relative abundance distributions remained the same for fern-dwelling ants, but became less even for oil palm ants in both the canopy and the leaf litter. These differences may be due in part to the ability of bird’s nest ferns to provide a stable microclimate in hot, dry plantations. We also found that non-native ant species were more abundant in oil palm than in forest, and few forest ant species survived in plantations in any of the microhabitats. Only 59 of the 309 forest species persisted in oil palm plantations, corresponding to an 81% loss of forest species resulting from habitat conversion. Although oil palm supports many more ant species than has been previously reported, converting forest into plantation still leads to a dramatic reduction in species richness. The maintenance of forested areas is therefore vital for the conservation of ant biodiversity.