An online real-time correction method and system for a positron emission tomography (PET) detector. The method includes: acquiring a drifted channel number of a peak position of a full-energy peak in a drifted energy spectrum after a gain value of a PET detector system has changed and a ratio of a currently accumulated energy of each signal channel to a current total accumulated energy of all signal channels; substituting the above parameters, an initial channel number of the peak position of the full-energy peak in an initial energy spectrum and a ratio of an initially accumulated energy of each signal channel to a total initially accumulated energy of all of the signal channels in the PET detector system into a gain adjustment ratio calculation formula to calculate a gain adjustment ratio; and adjusting, according to the gain adjustment ratio, a gain value of the PET detector system.