The consumption of wild plants, raw or cooked, is a common practice across many countries. However, some wild plants have toxins harmful to humans. In this study, we developed specific primer targeting chloroplast genes to distinguish the edible plant, Petasites japonicus, and the toxic plant, Farfugium japonicum. The performance of the designed primers was evaluated through a qPCR assay, assessing their specificity, sensitivity, and practical applicability. Six primer (three each for P. japonicus and F. japonicum) demonstrated linearity with correlation coefficients above 0.99 and slopes ranging from - 3.337 to - 3.581. PCR efficiencies were calculated to range from 90.28 to 97.86%, with a detection limit of 0.001 ng of DNA, and a quantitative threshold of 0.1% (w/w). The specificity was confirmed with 13 non-target plant species, and efficiency validated using 15 commercial samples. The assay help prevent mistaking toxic wild plants and provide guidelines to identify toxic plants for public safety.