Natural habitat plays an important role in maintaining biodiversity. Both cropland expansion and urban expansion have an influence on natural habitat. However, it is not clear which one impacts more seriously on both the quantity and quality of natural habitat. This study compared the impacts of cropland expansion on the quantity and quality of natural habitat in China between 2000 and 2015 with the impacts of urban expansion. Map algebra in ArcGIS 10.6 was used to calculate the changes in the quantity of natural habitat, while the Integrated Valuation of Ecosystem Services and Trade‐offs (InVEST) Habitat Quality model was used to assess the changes in its quality. The results indicated that cropland expansion led to a loss of 35,811 km2 of natural habitat, which was twelve‐times as much as that from urban expansion. Furthermore, the area of the heaviest habitat degradation due to cropland expansion was 9,530 km2, which was eight‐times as much as that due to urban expansion. Noticeably, the greatest impacts of cropland expansion on natural habitat mostly occurred in areas where the ecological environment is already vulnerable (namely, the resistance and resilience of ecosystems in response to external interference are weak), whereas the impacts of urban expansion were much less in these areas. This study highlights that the impacts of cropland expansion on both the natural habitat loss and degradation far exceeded the impacts of urban expansion. It is necessary to improve cropland protection policies to guarantee food security while ensuring little or no harm to natural habitat.