Gallbladder cancer, which is associated with the heavy metal toxicity, is one of the most dangerous malignancies. High occurrence of gallstones in the gallbladder is a well‐recognized risk factor for gallbladder cancer. Accumulation of heavy and toxic metals in the biliary system is one of the main causes of gallstone formation and leads to gallbladder cancer if it remains untreated. In this work, we investigate heavy and toxic metals in gallstones to identify their association as potential risk factors for gallbladder cancer. Detection and quantification of the heavy and toxic chemicals present in gallstones are important to define etiopathogenic factors that, in turn, are useful to identify preventive and therapeutic strategies. We quantified the heavy metals in gallstones collected from patients of different age groups and dietary habits. We carried out chemical composition studies of trace and heavy metal elements present in gallstones by applying Fourier transform infrared (FTIR) spectroscopy and wavelength‐dispersive X‐ray fluorescence (WD‐XRF) spectrometry. We also compared our experimental results with the results obtained from atomic absorption spectroscopy, as well as values previously reported in literature. These findings demonstrate the potential of WD‐XRF spectrometry and FTIR spectroscopy as important emerging diagnostic tools in the field of gastroenterology.