A simulation analysis shows that hepatitis C virus (HCV) testing and treatment in prisons for people who inject drugs could be a cost-effective way to reduce infections and deaths. These interventions would bring significant returns to the community. The combination of HCV testing and treatment is a key element of the strategy to eliminate the virus from the prison environment. The study highlights the potential of such measures in settings with a high risk of HCV transmission through shared needles.