The calculation of core level shifts can be done in the context of density functional theory (DFT) using different approaches and physical approximations to the photoemission process. The initial state and the SCF approximations are the most commonly used ones. Here, we describe the details of their implementation in the context of DFT using pseudopotentials and localized atomic orbitals as a basis set, and in particular as applied to the Siesta code. We give a full account of the technicalities involved in these calculations, including the details of the ionic pseudopotential generation, basis sets, charge states and reference potential. We test the method by computing the core level shifts of the Si 2p level for a series of molecules and the p(2×2) asymmetric-dimer reconstruction of the Si(001) surface. © EDP Sciences, Societá Italiana di Fisica, Springer-Verlag 2012.