It is possible only inside the nucleus and not otherwise as it can not decay to a state of greater mass. Inside a nucleus however, the situation is different, as the binding energy of a nucleus provides the necessary energy to compensate for the neutron-proton mass difference.