Overdose is the leading cause of death among people experiencing homelessness (PEH), but engagement in medication treatment is low in this population. Shelter-based buprenorphine may be a strategy for increasing initiation and retention on lifesaving medications. To estimate clinical outcomes and conduct an economic analysis of statewide shelter-based opioid treatment in Massachusetts. This economic evaluation study in Massachusetts used a cohort state-transition simulation model. Two cohorts were modeled starting in 2013, including (1) a closed cohort of a fixed population of PEH with history of high-risk opioid use over their lifetimes and (2) an open cohort in which membership could change over time, allowing assessment of population-level trends over a 10-year period. Data analysis occurred from January 2023 to April 2024. Model exposures included (1) no shelter-based buprenorphine (status quo) and (2) offering buprenorphine in shelters statewide. Outcomes included overdose deaths, quality-adjusted life-years (QALYs) gained, and health care and modified societal perspective costs. Sensitivity analyses were conducted on key parameters. In the closed cohort analysis of 13 800 PEH (mean [SD] age, 40.4 [13.1] years; 8749 male [63.4%]), shelter-based buprenorphine was associated with an additional 65.4 person-weeks taking buprenorphine over an individual's lifetime compared with status quo. Shelter-based buprenorphine was cost saving when compared with the status quo, with a discounted lifetime cost savings from the health sector perspective of $1300 per person, and 0.2 additional discounted QALYs per person and 0.9 additional life-years per person. In the population-level simulation, 254 overdose deaths were averted over the 10-year period with the shelter-based buprenorphine strategy compared with the status quo (a 9.2% reduction of overdose deaths among PEH in Massachusetts). Overdose-related and other health care utilization undiscounted costs decreased by $3.0 million and $66.4 million, respectively. Shelter-based opioid treatment generated $44.7 million in additional medication and clinical costs, but saved $69.4 million in overdose and other health costs. In this economic evaluation of clinical and economic outcomes among PEH, shelter-based buprenorphine was associated with fewer overdose deaths and was cost saving. These findings suggest that broad rollout of shelter-based buprenorphine may be an important tool in addressing the overdose crisis.