HIV prevalence and incidence has declined in East, Central, and Southern Africa (ECSA), but remains high among female sex workers (FSWs). Sex worker programmes have the potential to considerably increase access to HIV testing, prevention, and treatment. We aimed to quantify these improvements by modelling the potential effect of sex worker programmes at two different intensities on HIV incidence and key health outcomes, and assessed the programmes' potential cost-effectiveness in order to help inform HIV policy decisions. Using a model previously used to review policy decisions in ECSA, we assumed a low-intensity sex worker programme had run from 2010 until 2023; this resulted in care disadvantages among FSWs being reduced, and also increased testing, condom use, and willingness to take pre-exposure prophylaxis (PrEP). After 2023, three policy options were considered: discontinuation, continuation, and a scale-up of the programme to high-intensity, which would have a broader reach, and higher influences on condom use, antiretroviral therapy (ART) adherence, testing, and PrEP use. Outputs of the key outcomes (the percentage of FSWs who were diagnosed with HIV, on ART, and virally suppressed; the percentage of FSWs with zero condomless partners, and HIV incidence) were compared in 2030. The maximum cost for a sex worker programme to be cost-effective was calculated over a 50-year time period and in the context of 10 million adults. The cost-effectiveness analysis was conducted from a health-care perspective; costs and disability-adjusted life-years were both discounted to present US$ values at 3% per annum. Compared with continuing a low-intensity sex worker programme until 2030, discontinuation of the programme was calculated to result in a lower percentage of FSWs diagnosed (median 88·75% vs 91·37%; median difference compared to continuation of a low-intensity programme [90% range] 2·03 [-4·49 to 10·98]), a lower percentage of those diagnosed currently taking ART (86·35% vs 88·89%; 2·38 [-3·69 to 13·42]), and a lower percentage of FSWs on ART with viral suppression (87·49% vs 88·96%; 1·17 [-6·81 to 11·53]). Discontinuation of a low-intensity programme also resulted in an increase in HIV incidence among FSWs from 5·06 per 100 person-years (100 p-y; 90% range 0·52 to 22·21) to 4·05 per 100 p-y (0·21 to 21·15). Conversely, comparing a high-intensity sex worker programme until 2030 with discontinuation of the programme resulted in a higher percentage of FSWs diagnosed (median 95·81% vs 88·75; median difference compared to discontinuation [90% range] 6·36 [0·60 to 18·63]), on ART (93·93 vs 86.35%; median difference 7·13 [-0·65 to 26·48]), and with viral suppression (93·21% vs 87·49; median difference 7·13 [-0·65 to 26·48]). A high-intensity programme also resulted in HIV incidence in FSWs declining to 2·23 per 100 p-y (0·00 to 14·44), from 5·06 per 100 p-y (0·52 to 22·21) if the programme was discontinued. In the context of 10 million adults over a 50-year time period and a cost-effectiveness threshold of US$500 per disability-adjusted life-year averted, $34 million per year can be spent for a high-intensity programme to be cost-effective. A sex worker programme, even with low-level interventions, has a positive effect on key outputs for FSWs. A high-intensity programme has a considerably higher effect; HIV incidence among FSW and in the general population can be substantially reduced, and should be considered for implementation by policy makers. Wellcome Trust.