Intrinsic room-temperature ferromagnetism was detected over n-type carbon-doped ZnO prepared through solid-state reaction. Our results of first-principle calculations based on density functional theory revealed that the CZn 4 O 12 unit is the origin of magnetic moment in the carbon-doped ZnO system. The carbon component has a significant contribution to the net magnetic moment, and any oxygen vacancy present in CZn 4 O 12 has a negative effect on the magnetic properties of the system. Moreover, both antiferromagnetic and ferromagnetic interactions are predicted among carbon atoms located at different CC distances. The result suggests that the defect density influenced by the distribution of carbon has a significant effect on the magnetic properties of the carbon-doped ZnO system.