Radiation protection is crucial for the safe utilization of ionizing radiation and minimizing the harmful effect upon exposure, hence some standards have been defined by some relevant organizations for the safe uses of radiation. One of the parameters relevant to the calculation of gamma ray shielding is the half-value layer (HVL), which is normally calculated using the knowledge of linear attenuation coefficient (μ). In this research, an attempt has been made to directly calculate HVL without the knowledge of μ via Monte Carlo simulation technique. For this purpose, in the Monte Carlo N‐Particle eXtended (MCNPX) code, F1, F5 and Mesh Popul sequences tallies were defined and the optimal structure for the least measurement error was introduced. The MCNPX calculated values showed reasonable agreement with the experimental findings. According to the obtained results, it is suggested that in order to reduce the error of HVL calculations, in exchange for the MCNPX code, the values of the R parameter and the radiation angle of the source should be considered according to the calculations introduced in this plan. Because the results show that by considering the measurement error between 6 and 20%, the code output can be cited in different energy ranges.