In this work, the use of agricultural waste from oil palm petioles (OPP) as a raw material for the production of activated carbon (AC) and its characterization were examined. By soaking these chars in nitric acid (HNO3) and potassium hydroxide (KOH) at a 10% concentration, AC with favorable high-porosity carbons was generated. To maximize AC synthesis, the AC was pyrolyzed at 460, 480, and 500 °C temperatures for 20 min. Based on micrographs of formed pores and surface functional groups, 480 °C carbonization temperature on both chemical HNO3 and KOH was shown to be the best. The FTIR measurements reveal that chemical activation successfully transformed the raw material into AC. Moreover, FESEM micrographs show the pores and cavities of the prepared AC achieve a high surface area. This is further supported by BET results of HNO3 OPP AC and KOH OPP AC with surface areas of 883.3 and 372.4 m2/g, respectively, compared with the surface area of raw OPP of 0.58 m2/g. Furthermore, the tests were revealed by an optimization model, namely response surface methodology (RSM), using a central composite design (CCD) technique. The findings showed that all three parameters (pH, time, and dose) had a substantial impact on the removal of Zn, Fe, and Mn. Analysis of variance (ANOVA) and analytical error indicated that the models were accurate, with a low error value and a high R2 > 0.9. Remarkably, the good correlation between actual and predicted removal values showed that the modified activated carbon is a promising adsorbent for heavy metal removal from wastewater.