In this paper, the random packing of spherocylinders of different aspect ratios is simulated with an improved geometric based relaxation algorithm. It is shown that the packing density increases to a maximum and then decreases with the growth of aspect ratio, which is consistent with the literature results. However, the maximum packing density reaches 0.722 when the aspect ratio is 0.5, higher than those reported. The positions and orientations of the particles are demonstrated to be randomly distributed. The first three peaks in the radial distribution function g(r) may correspond to three possible local structures, and the second peak moves in the positive direction of the r-axis with the increase of aspect ratio. The coordination number results generally agree with those reported in the literature. Nevertheless, considering that a spherocylinder consists of a cylinder and two hemispherical parts, different types of contacts can be identified, including sphere-sphere, sphere-cylinder, and cylinder-cylinder contacts. The sphere-sphere contacts decrease and cylinder-cylinder contacts increase with the increase of aspect ratio. The findings are useful for a better understanding of the packing of spherocylinders.