Scanning transmission electron microscope (STEM) images of three-dimensional (3D) samples were simulated. The samples consisted of a micrometer(s)-thick substrate and gold nanoparticles at various vertical positions. The atomic number (Z) contrast as obtained via the annular dark-field detector was generated. The simulations were carried out using the Monte Carlo method in the CASINO software (freeware). The software was adapted to include the STEM imaging modality, including the noise characteristics of the electron source, the conical shape of the beam, and 3D scanning. Simulated STEM images of nanoparticles on a carbon substrate revealed the influence of the electron dose on the visibility of the nanoparticles. The 3D datasets obtained by simulating focal series showed the effect of beam broadening on the spatial resolution and on the signal-to-noise ratio. Monte Carlo simulations of STEM imaging of nanoparticles on a thick water layer were compared with experimental data by programming the exact sample geometry. The simulated image corresponded to the experimental image, and the signal-to-noise levels were similar. The Monte Carlo simulation strategy described here can be used to calculate STEM images of objects of an arbitrary geometry and amorphous sample composition. This information can then be used, for example, to optimize the microscope settings for imaging sessions where a low electron dose is crucial for the design of equipment, or for the analysis of the composition of a certain specimen.