The COVID-19 pandemic has changed the daily lives of people, and countries worldwide have implemented public health measures that restricted social contact and interactions. Individuals in isolation displayed increased mental health issues, for whom windows are a crucial means of connecting with the outside world. However, few studies have discussed the effect of having a window view on the mental health of individuals in quarantine. This study uses a natural experiment to address this knowledge gap. Between January 27, 2022 and June 19, 2022, individuals in Taiwan who were assigned to quarantine hotel room with various window views were recruited through Facebook groups. Participants completed a baseline assessment at the beginning of their quarantine period that included room and window conditions and mental health conditions, followed by a posttest assessment of the same mental health measures. Questions related to window conditions included the proportions of natural and urban landscapes viewable from their hotel windows, human activities they could observe (flow of people), and their viewshed broadness. Subsequently, this study investigated how visual access to greenness influenced the positive mental health, depression, and stress of the participants before and during quarantine. In total, 81 participants participated. The results of this study indicated that viewing vegetation and the ratio of windows to walls were associated with improved mental health, reduced symptoms of depression, and reduced stress. Specifically, an open view in the room was associated with lower levels of depression ( < 0.001) and stress ( < 0.000). Additionally, viewing people through windows was associated with reduced depressive symptoms ( < 0.006). The results of this study can inform policies for pandemic containment, but also broadly for health care, hospitals, and other related fields.