The mass of a proton has only been calculated to an accuracy of around 4% - (roughly 938 MeV/c2 or 1.672 × 10-27 kg). The constituent particles - quarks and gluons - which make up the proton have individual masses that add up to only around 1% or so of the measured mass (which can be determined accurately with specialised devices called Penning traps).1)
In order to explain the missing 99%, the constituent particles are thought to be vibrating (and otherwise interacting) at near light-speed - which, because of relativistic effects, increases their mass (plus the interaction-energy of the strong nuclear forces that hold the proton together).
The calculations are so complex that supercomputers are needed. And the accuracy of the calculations still has a 4% error margin.
Note: Similar lack of precision affects calculations the mass of neutrons.
Also see : Proton radius puzzle