If your transit/layover is 24 hours or less, you will not need a visa as long as you have a confirmed onward ticket. You will need to go through immigration and show your passport and onward ticket, where they will stamp a special stopover permit, free of charge.
If your transit time/layover is greater than 24 hours, you can apply for a 72 hour transit visa-free permit upon arrival. This is available for citizens of 51 countries, including the US., as long as the following criteria are met:
- Hold a valid passport
- Qualify for entry requirements for the next country
- Hold a confirmed airline ticket departing within 72 hours of arrival
- Flying into one of the following airports: Beijing (PEK), Chengdu (CTU), Chongqing (CKG), Dalian (DLC), Guangzhou (CAN). Guilin (KWL),Hangzhou (HGH), Shanghai Hongqiao (SHA), Shanghai Pudong (PVG), Shenyang (SHE), Xiamen (XMN), Wuhan (WUH) and Xi’An (XIY)
You will not be allowed to leave the transit city during the 72 hours, with the exception of Guangzhou and Hangzhou, which allow you to visit Guangdong and Zhejiang provinces, respectively.