Electron affinity is the energy change when an atom gains an electron. Nonmetals generally have higher electron affinity than metals, reflecting their tendency to gain electrons.
From your study of periodic trends, you know that atomic properties like atomic radius and ionization energy change systematically across periods and down groups because of how nuclear charge and electron shielding interact. Electron affinity adds another dimension to this picture: instead of asking how hard it is to *remove* an electron (ionization energy), it asks how much energy is released or absorbed when a neutral atom *gains* an electron to form an anion. Specifically, it is the energy change for the process X(g) + e⁻ → X⁻(g).
For most nonmetals, this process releases energy — the atom is more stable with the extra electron than without it. By convention, a negative electron affinity value means energy is released (exothermic), and a more negative value means the atom has a stronger "desire" to gain that electron. Think of it this way: a chlorine atom is one electron short of a filled valence shell. When it gains that electron, it achieves the stable electron configuration of argon, and the system drops to a lower energy state, releasing 349 kJ/mol. This is one of the highest electron affinities in the periodic table, which explains why chlorine so readily forms Cl⁻ ions.
The periodic trend generally mirrors what you saw with ionization energy but in reverse perspective. Electron affinity becomes more negative (stronger) as you move from left to right across a period, because increasing nuclear charge pulls the incoming electron more strongly while atomic radius shrinks. Moving down a group, electron affinity generally becomes less negative (weaker) because the incoming electron is added to a shell farther from the nucleus, where it feels less nuclear attraction and more shielding from inner electrons. However, this trend has notable exceptions. The noble gases have essentially zero or positive electron affinities because their valence shells are already full — adding an electron would mean starting a new, higher-energy shell with no stabilization. Nitrogen, with its half-filled 2p subshell, also has a surprisingly low electron affinity because the incoming electron must pair with an existing electron, introducing repulsion.
Understanding electron affinity alongside ionization energy gives you a complete picture of an element's tendency to form ions. Elements with high ionization energies *and* strongly negative electron affinities (like the halogens) are eager electron acceptors — they form anions easily. Elements with low ionization energies *and* weak electron affinities (like the alkali metals) are eager electron donors — they form cations easily. This complementary relationship is what drives ionic bond formation and underpins the concept of electronegativity that you will encounter next.