Activated carbon (AC) is one of the most used materials in dye removal that can be synthesized using different agricultural wastes. In this work, the effects of waste type and pyrolysis temperature were investigated. Corn cob and wheat straw were used for preparation of activated carbon by applying 10 % H3PO4 as an activating agent, followed by pyrolysis at 400 or 500 °C and then thermal activation at 800 °C for 10 minutes. Elemental analysis, acid soluble matter, ash content, and calorific value were measured for the prepared samples of AC. Finally, the product was applied for adsorption of Congo Red and Nile Blue dyes from wastewater and the maximum adsorption capacity was found to be 99.56 and 85.23 mg g−1, respectively using a corn cob sample activated at 500 °C.