Variation in the formation energy of stacking faults (SFs) with the contamination of Na atoms was examined in Si crystals with different Fermi levels. Na atoms agglomerated at SFs under an electronic interaction, reducing the SF formation energy. The energy decreased with the decrease of the Fermi level: it was reduced by more than 10 mJ/m2 in p-type Si, whereas it was barely reduced in n-type Si. Owing to the energy reduction, Na atoms agglomerating at SFs in p-type Si are stable compared with those in n-type Si, and this hypothesis was supported by ab initio calculations.