X-ray fluorescence technique plays an important role in nondestructive analysis nowadays. The development of equipment, including portable ones, enables a wide assortment of possibilities for analysis of stable elements, even in trace concentrations. Nevertheless, despite of the advantages, one important drawback is radiation self-attenuation in the sample being measured, which needs to be considered in the calculation for the proper determination of elemental concentration. The mass attenuation coefficient can be determined by transmission measurement, but, in this case, the sample must be in slab shape geometry and demands two different setups and measurements. The Rayleigh to Compton scattering ratio, determined from the X-ray fluorescence spectrum, provides a link to the mass attenuation coefficient by means of a polynomial type equation. This work presents a way to construct a Rayleigh to Compton scattering ratio versus mass attenuation coefficient curve by using the MCNP5 Monte Carlo computer code. The comparison between the calculated and literature values of the mass attenuation coefficient for some known samples showed to be within 15%. This calculation procedure is available on-line at www.macx.net.br. (C) 2014 Elsevier B.V. All rights reserved.