A concise procedure to determine the self-consistent Fermi energy and defect and carrier concentrations in an extended crystalline system is presented. It is assumed that the formation enthalpies of a set of variously charged point defects in thermodynamic equilibrium are known, as well as the density of electronic states in the defect-free system. By applying the constraint of overall charge neutrality, the self-consistent Fermi energy is determined using an iterative searching routine. The procedure is incorporated within a Fortran code ‘SC-FERMI’: the input consists of the defect formation energies, density of sites where they can form, and the degeneracy of each charge state; the material band gap; and the calculated density of states of the pristine system. The output is the self-consistent Fermi energy, the total concentrations of each defect as well as the concentration of its individual charge states, and the free carrier concentrations. Furthermore, the procedure facilitates fixing the concentration of one or more defects and determining the resulting self-consistent Fermi energy and concentrations of other defects (performed using the related code ‘FROZEN-SC-FERMI’), thus modelling ‘frozen-in’ defects which may form by kinetic, rather than thermodynamic, processes. One can fix the total concentration or the concentration of a particular charge state; it is also possible to introduce new defects with a fixed concentration, but here the charge state must be specified. The background theory is discussed in some detail, and the operation of the program is demonstrated by some examples. Program summaryProgram Title:SC-FERMIProgram Files doi:http://dx.doi.org/10.17632/dh3hjdf4fc.1Licensing provisions: MIT licenseProgramming language:FORTRAN 90Nature of problem: To determine the self-consistent Fermi energy and equilibrium defect and carrier concentrations given a set of point defect formation energies in a crystalline system, assuming the constraint of charge neutrality.Solution method: The concentrations of each defect in each charge state are calculated, as are the free carrier concentrations. These concentrations are functions of the Fermi energy. The code, using an iterative search algorithm, determines the Fermi energy that satisfies the charge neutrality constraint (the self-consistent Fermi energy). The defect and carrier concentrations at that Fermi energy are then reported, as well as the Fermi energy itself.Restrictions: Thermodynamic equilibrium is assumed. The defect formation enthalpies and electronic density of states of the pristine system must be known.Additional comments: The concentrations of defects can be fixed to a particular value, thus modelling ‘frozen-in’ defects formed by e.g. kinetic processes. This procedure is facilitated by the related program, FROZEN-SC-FERMI, which is identical to SC-FERMI apart from the additional defect concentration fixing routine.