The self-consistent electronic structures of ideal vacancies in nine III-V compound semiconductors and in Si and Ge have been calculated using the spin-unrestricted density-functional theory and the linear muffin-tin-orbital Green function method. Moreover, anti-site defects in these compound semiconductors have been investigated. The ionisation levels in the band gap have been determined from the total energies for all types of vacancies in different charge states. The trends in the ionisation level positions are studied when the width of the band gap and the 'size' of the vacancy are varying from one host to another. The results are compared with previous calculations and experiments, and the effects due to lattice relaxation are discussed.