In the present paper, the size and temperature effects on lattice distortion of Ag and Pt nanoparticles have been investigated in terms of atomic mean bond length using the molecular dynamics simulations and the modified analytic embedded atom method. It is found that the lattice contraction ratio decreases linearly with the reciprocal of the particle size. The average value of lattice contraction over the whole system is larger than that of the experimental data, and the average value of lattice contraction in the inner core has a better agreement with the experiment results. This phenomenon is mainly resulted by inhomogeneous lattice distortion. The surface distortion and the size effect on the inner core distortion are remarkable. As the grain size increases to a certain degree, the inhomogeneous surface lattice distortion is mainly localized to the outer shell with a thickness of 2-3 lattice parameters.