Human toxocariasis, a worldwide parasitic disease, is caused by the larval stage of intestinal nematodes of dogs and cats, namely Toxocara canis and Toxocara cati. Human infection occurs by the accidental ingestion of embryonated eggs present in the soil, vegetables or on other contaminated surfaces, as well as via consumption of uncooked paratenic hosts, such as bird meat and giblets. The objective of this study was to evaluate the contamination of soil in public parks and playgrounds in Shiraz using microscopy and molecular methods. A total of 150 soil samples were collected from public parks and playgrounds in various areas of Shiraz, southern Iran. The samples were treated with saturated zinc sulphate solution, and Toxocara spp. eggs were detected by microscopic observation followed by nested polymerase chain reaction (PCR). To differentiate T. canis and T. cati eggs from each other, PCR restriction fragment length polymorphism (RFLP) of the internal transcribed spacer (ITS)-rDNA region by SalI endonuclease enzyme was used. PCR-sequencing was performed to confirm the results of the PCR-RFLP method. Based on the flotation results of the 150 soil samples, six (4%) were found to be positive for Toxocara spp. eggs, whereas nested-PCR showed 24 samples to be positive (16%). Based on the PCR-RFLP method and the sequence of the ITS-rDNA region, a total of 23 out of 24 isolates were confirmed as T. cati and one out of 24 as T. canis. The results showed a higher number of soil samples to be positive for Toxocara by the molecular method than microscopy, and higher T. cati infection in soil samples, which could have an important role in human infection with toxocariasis in this region.