The effects of selective logging on the diversity and species composition of moths were investigated by sampling from multiple sites in primary forest, both understorey and canopy, and logged forest at Danum Valley, Sabah, Malaysia. The diversity of individual sites was similar, although rarefied species richness of logged forest was 17% lower than for primary forest (understorey and canopy combined). There was significant heterogeneity in faunal composition and measures of similarity (NESS index) among primary forest understorey sites which may be as great as those between primary understorey and logged forest. The lowest similarity values were between primary forest understorey and canopy, indicating a distinct canopy fauna. A number of species encountered in the logged forest were confined to, or more abundant in, the canopy of primary forest. Approximately 10% of species were confined to primary forest across a range of species' abundances, suggesting this is a minimum estimate for the number of species lost following logging. The importance of accounting for heterogeneity within primary forest and sampling in the canopy when measuring the effects of disturbance on tropical forest communities are emphasized.