In Indonesia, a significant number of tuberculosis (TB) cases may be missed, due to the low sensitivity and specificity of the currently used diagnostic algorithm. In this regard, the rapid molecular test using Xpert MTB/RIF, which has recently been introduced in Indonesia, can improve case detection. Thus, this study determined the cost and affordability of incorporating Xpert MTB/RIF testing for TB diagnosis. For this purpose, we estimated the costs (from the health system and societal perspectives) of reaching the TB detection target in Depok municipality, and applied the findings to the West Java province of Indonesia. The resources available for the health and TB program were also analyzed to support the decision to scale up the TB diagnosis using Xpert MTB/RIF testing. According to the results, the unit cost for TB diagnosis per person was USD 27.22 and USD 70.16 from the health system and societal perspectives, respectively. To reach the target of 109,843 TB cases for the 2020–2024 time period, Depok municipality would need USD 2,989,927 and USD 2,549,455 from the health system viewpoint, assuming the machine’s lifespan of five and 10 years, respectively. Extrapolating these results to the West Java province, USD 56,353,833 would be necessary to test 2,076,413 cases from 2019 to 2024. However, in order to accelerate the case detection target up to 2024, West Java requires additional funds. The implication of the findings is that the central government must consider local capacity to accelerate TB case detection and ensure that the installation of Xpert MTB/RIF machines is included in the overall costs.