Alleghany County is a county located in the U.S. state of North Carolina. As of the 2020 census, the population was 10,888. Its county seat is Sparta.