The atomic mass of an element listed on the periodic table is often not a whole number because it takes into account the weighted average of the masses of all naturally occurring isotopes of that element.
Isotopes are variants of an element that have the same number of protons but different numbers of neutrons. Since the atomic mass is calculated by considering the relative abundance of each isotope, and their respective masses, it can result in a decimal value.
For example, let's consider oxygen. Oxygen has three naturally occurring isotopes: oxygen-16, oxygen-17, and oxygen-18. The most abundant isotope is oxygen-16, followed by oxygen-18 and oxygen-17. Each isotope contributes to the overall atomic mass of oxygen based on its abundance and mass.
The atomic mass listed for oxygen, approximately 16 atomic mass units, is the weighted average of the masses of these isotopes. It means that, on average, an oxygen atom is 16 times heavier than 1/12th the mass of a carbon-12 atom.
So, the atomic mass is a weighted average taking into account the abundance of each isotope, which is why it can be a decimal value rather than a whole number.