Rising soil pollution has recently emerged as a significant global issue as a result of increased industrialization, urbanization, and inadequate waste management. In Rampal Upazila, soil contamination with heavy metals resulted in a significant deterioration of quality of life and life expectancy, so the study's goal is to appraise the level of heavy metal contamination in soil samples. Inductively coupled plasma−optical emission spectrometry was used to identify 13 heavy metals (Al, Na, Cr, Co, Cu, Fe, Mg, Mn, Ni, Pb, Ca, Zn, and K) from 17 soil samples that were collected at random from Rampal. Enrichment factor (EF), geo-accumulation index (I geo ), contamination factor (CF), pollution load index, elemental fractionation, and potential ecological risk analysis were used to evaluate the level of pollution and sources of metal. The average concentration of heavy metals implies that they are below in the permissible limit except for Pb. Environmental indices also showed the same result for Pb. The ecological risk index (RI) for six elements�Mn, Zn, Cr, Fe, Cu, and Pb�is 26.575. For investigating the behavior and origin of elements, multivariate statistical analysis was also applied. From the EF, Na, Cr, Fe, and Mg are in the anthropogenic region, and Al, Co, Cu, Mn, Ni, Ca, K, and Zn are minorly polluted, but Pb is highly contaminated in the Rampal area. The geo-accumulation index exhibits that Pb is slightly contaminated but others are not, while CF shows no contamination in this region. From the ecological RI, the value which is below 150 is called uncontaminated, which indicates that our studied area is ecologically free. There are various classifications of heavy metal contamination in the study area. Therefore, regular monitoring of soil pollution is required, and the public awareness needs to be raised to ensure a safe environment.