The sense of enclosure is one of the factors that influence the quality and experience of urban space. Among the physical elements of urban space, the D/H ratio is directly related to the sense of enclosure. Many urban design theorists have argued that when the D/H ratio is between 1/1 and 3/1, pedestrians feel most stable. However, the appropriate D/H ratio suggested by most theorists is based on personal experience or intuition. There is no consensus on the optimal D/H ratio, so research is needed to empirically prove it with real urban spaces. Therefore, the purpose of this study is to prove the relationship between the D/H ratio and the enclosure using immersive virtual reality (IVR) and to calculate the optimal D/H ratio that pedestrians feel most stable. After that, the calculated optimal D/H ratio was compared with that suggested by theorists. For this study, 12 target sites of urban spaces in Seoul were selected and recorded as IVR videos, and then a visual assessment survey was conducted. Participants were recruited through the snowball sampling method, and as a result of sampling, a total of 40 students majoring in physical planning participated in the study. A total of 480 data (40 participants x 12 IVR videos) were collected through the survey, and the data were analyzed through the OLS regression model and the quadratic regression model. The results of the study showed that as the D/H ratio increased, pedestrians felt more open, and the optimal level of the D/H ratio was 1.936. This result is consistent with the theories of urban designers such as Lynch. This study is significant in that it not only empirically proved the urban design theory but also suggests the possibility of utilizing IVR in urban design research and as an alternative to traditional research methods.