BackgroundEcotourism as a responsible travel to natural areas is proposed as a strategy for forest conservation by enhancing the livelihoods of local communities. However, engaging in environmentally friendly behaviors during forest visit is a crucial factor in achieving this conservation. This study aimed to examine the determinants of intention and actual environmental behavior among ecotourists during their visits to forests.MethodsUtilizing social cognitive theory as the theoretical framework, the data from 409 visitors of recreational forest were analyzed. After confirming the validity and reliability of the data, structural equation modeling was employed for analysis.ResultsThe results indicated that the model could explain 59% of the behavioral intention and 27% of the actual environmentally friendly behaviors of ecotourists during their forest visits. Additionally, social influence and the behaviors of other ecotourists were identified as two significant determinants of individuals’ behavioral intention. Self-efficacy and behavioral intention also emerged as significant factors which shape the actual environmental behaviors of tourists, positively.DiscussionThe findings suggest that social expectations, learning from fellow tourists, and enhancing individuals’ abilities while addressing barriers to exhibiting environmentally friendly behaviors should be prioritized in promotional planning for ecotourism.