O2 and B2 are paramagnetic because they have unpaired electrons.
How do you know if a diatomic molecule is paramagnetic?
The magnetic properties of a substance can be determined by examining its electron configuration: If it has unpaired electrons, then the substance is paramagnetic and if all electrons are paired, the substance is then diamagnetic.
What is diatomic and paramagnetic?
Whenever two electrons are paired together in an orbital, or their total spin is 0, they are diamagnetic electrons. Atoms with all diamagnetic electrons are called diamagnetic atoms. A paramagnetic electron is an unpaired electron. An atom is considered paramagnetic if even one orbital has a net spin.