Using the gauge/gravity duality, we calculate the electromagnetic contributions to hadron masses, where mass generates dynamically by strong QCD interactions. Based on the Sakai-Sugimoto model of holographic QCD we find that the electromagnetic mass of proton is 0.48 MeV larger than that of neutron, which is in agreement with recent lattice results. Similarly for pions we obtain m π ± − m π 0 = 1.8 MeV, roughly half of the experimental value. The electromagnetic mass of pions is found to be independent of N c and 't Hooft coupling and its scale is set only by the Kaluza-Klein scale of the model, M KK = 949 MeV.