# If fluorine has a lower electron affinity than chlorine, why does it have a higher ionization energy?

I have read that fluorine has a lower electron affinity than chlorine despite its lower atomic radius because its electron cloud is extremely dense. If this is the case, shouldn't the ionization energy of fluorine be lower than that of chlorine, since fluorine's dense electron cloud should eagerly repel its electrons?

Even more confusing is that electron affinity can also be defined as the ionization energy of the singly charged anion form of an atom, i.e. the ionization energy of $\ce{Cl-}$ is equal in magnitude to the electron affinity of $\ce{Cl}$. Therefore, it seems that the trends for ionization energy and electron affinity should always match, which is not the case with fluorine and chlorine.

To quote chemguide:

The first ionisation energy is the energy required to remove the most loosely held electron from one mole of gaseous atoms to produce 1 mole of gaseous ions each with a charge of 1+.

That means, the ionization energy of fluorine is the energy of the following reaction:

$$\ce{F -> F+ + e-}$$

The ionization energy of chlorine is the energy of the following reaction:

$$\ce{Cl -> Cl+ + e-}$$

Since the most loosely held electron in fluorine is closer to the nucleus than chlorine, it takes more energy to remove the electron from fluorine than in chlorine.

The ionization energy of chloride ion ($$\ce{Cl-}$$) is the energy of the following reaction:

$$\ce{Cl- -> Cl + e-}$$

The electron affinity of $$\ce{Cl}$$ is the energy of the following reaction:

$$\ce{Cl + e- -> Cl-}$$

As a result, their energies are equal in magnitude but opposite in sign.

Why does chlorine have a higher electron affinity than fluorine?