In 2009, we examined HIV and sexually transmitted infections (STIs) in 750 female sex workers (FSWs) in Shanghai using a cross-sectional survey. Participants (mean age 27 years) were interviewed and tested for HIV and selected STIs. Prevalence was: HIV 0·13%, chlamydia 14·7%, gonorrhoea 3·5% and syphilis 1·3%. In a demographic multivariate model, younger age, higher income and originating from provinces other than Zhejiang and Shanghai were independently associated with STI. In a social and sexual behavioural model, women working in small venues with fewer clients per week, use of drugs, and higher price charged per sex act indicated a greater risk for STI. Although HIV appears rare in Shanghai FSWs, chlamydial infection is common, especially in women aged <25 years (prevalence 19·6%). Since STI and HIV share similar risk factors, preventive intervention measures should be implemented immediately based on the venues and characteristics of FSWs to prevent future spread of HIV.