A neutron has a slightly greater mass than a proton. According to Dick Plano, professor emeritus of physics at Rutgers University, there are many hypotheses for the mass difference, but a universally accepted hypothesis does not exist.
One theory is that a neutron contains a proton and an electron and therefore has a greater mass than a single proton. Because the mass difference between a proton and a neutron is greater than the mass of a single electron, this theory does not hold up. Another theory uses the different quark makeup of a proton and neutron to explain the mass difference. This theory is promising, but because of electromagnetic forces and other interactions between particles, it is difficult to prove in a controlled environment.