Background: Similarly to several other upper-middle-income countries, there is a major shortfall in radiotherapy services for the treatment of cancer in Brazil. In this study, we developed the linear accelerator (LINAC) shortage index to assess the LINAC shortage and support the prioritisation of new LINAC distribution in Brazil. Methods: This cross-sectional, population-based study used data from the National Cancer Institute 2020 Cancer estimates, the Ministry of Health 2019 radiotherapy census, the Minister of Health radiotherapy expansion programme progress reports, and the Fundação Oncocentro de São Paulo public database of the Cancer Hospital Registry of the State of São Paulo to calculate the LINAC shortage index. Data collected were number of new cancer cases in Brazil, number of LINACs per region and state, number of cancer cases treated with radiotherapy, patient state of residence, and radiotherapy treatment centre and location. National, regional, and state-level data were collected for analysis. LINAC numbers, cancer incidence, geographical distribution, and radiotherapy needs were estimated. A LINAC shortage index was calculated as a relative measure of LINAC demand compared with supply based on number of new cancer cases, number of patients requiring radiotherapy, and the number of LINCAS in the region or state. We then built a prioritisation framework using the LINAC shortage index, cancer incidence, and geographical factors. Finally, using patient-level public cancer registry data from the Fundação Oncocentro de São Paulo and Google maps, we estimated the geospatial distance travelled by patients with cancer from their state of residence to radiotherapy treatment in São Paulo from 2005–14. Non-parametric statistics were used for analysis. Findings: Data were collected between Feb 2 and Dec 31, 2021. In 2020, there were 625 370 new cancer cases in Brazil and 252 LINAC machines. The number of LINACs was inadequate in all Brazilian regions, with a national LINAC shortage index of 221 (ie, 121% less than the required radiotherapy capacity). The LINAC shortage index was higher in the midwest (326), north (313), and northeast (237) regions, than the southeast (210) and south (192) regions. Four states (Tocantins, Acre, Amapá, and Roraima) in the north region were ranked first on the prioritisation rank due to no availability of LINACs. There was an association between LINAC shortage index and the number of patients who travelled to receive radiotherapy (p<0·0001). Patients living in the midwest (793 km), north (2835 km), and northeast (2415 km) regions travelled significantly longer average distances to receive radiotherapy treatment in São Paulo than patients living in the southeast or south regions (p=0·032). The reduced number of LINACs in these regions was associated with longer distance travelled (p=0·032). Interpretation: There is substantial discordance between distribution of cancer cases and LINAC availability in Brazil. We developed a tool using the LINACs shortage index to help prioritise the development of radiotherapy infrastructure across Brazil; this approach might also be useful in other health systems. Funding: None.