In the present work, combining with the Geiger-Nuttall law, a two-parameter empirical formula is proposed to study the two-proton (2p) radioactivity. Using this formula, the calculated 2p radioactivity half-lives are in good agreement with the experimental data as well as the calculated ones obtained by Goncalves et al. ([Phys. Lett. B 774, 14 (2017)]) using the effective liquid drop model (ELDM), Sreeja et al. ([Eur. Phys. J. A 55, 33 (2019)]) using a four-parameter empirical formula and Cui et al. ([Phys. Rev. C 101: 014301 (2020)]) using a generalized liquid drop model (GLDM). In addition, this two-parameter empirical formula is extended to predict the half-lives of 22 possible 2p radioactivity candidates, whose the 2p radioactivity released energy Q2p>0, obtained from the latest evaluated atomic mass table AME2016. The predicted results have good consistency with ones using other theoretical models such as the ELDM, GLDM and four-parameter empirical formula.