Objective To obtain the basic data of lead and cadmium exposure from food for Shanghai residents, and to estimate the health risk of dietary lead and cadmium contamination in Shanghai. Methods A method recommended by WHO on the dietary exposure assessment of chemicals in food was applied. Surveillance on the content of lead and cadmium in food combined with a survey on dietary nutrients intake of Shanghai residents was conducted. Results The average dietary lead and cadmium exposure of Shanghai residents per week were estimated to be 0.0062 mg/kg BW and 0.0025 mg/kg BW, accounted for 24.77% and 35.06% of Provisional Tolerable Weekly Intake (PTWI), respectively. The dietary lead and cadmium exposure per week of top consumers (the food consumption was higher than the upper 90th percentile) were estimated to be 0.0123 and 0.0048 mg/kg BW, accounted for 49.08% and 68.09% of PTWI. Conclusion The level of dietary cadmium exposure in Shanghai residents was higher than that of dietary lead exposure. Although both dietary lead and cadmium exposure level in Shanghai residents is usually lower than PTWI, cutting it down is necessary.