‘G4argo’, a GEANT4-based simulation package for the ARGO-YBJ detector, is described in this paper. G4argo incorporates in the simulation the true RPC time resolution and another 0.5 ns time uncertainty which is introduced from the offline calibration of TDC. In addition, the correct RPC geometry and the true materials for the ARGO-YBJ experimental hall are implemented. As a result, G4argo simulation shows a very good agreement with real data.