We report calculations of core excitation energies and near-edge X-ray absorption fine structure (NEXAFS) spectra computed with time-dependent density functional theory (TDDFT). TDDFT with generalized gradient approximation and standard hybrid exchange–correlation functionals is known to underestimate core excitation energies. This failure is shown to be associated with the self-interaction error at short interelectronic distances. Short-range corrected hybrid functionals are shown to reduce the error in the computed core excitation energies for first and second row nuclei in a range of molecules to a level approaching that observed in more traditional excited states calculations in the ultraviolet region. NEXAFS spectra computed with the new functionals agree well with experiment and the pre-edge features in the NEXAFS spectra of plastocyanin are correctly predicted.