Background In recent years, interest in digital games has grown significantly and at the same time a range of games in 2D and 3D has been created. While 2D games cannot give depth to objects, 3D games creates spatial depth. The growth of the gaming industry has raised concerns among some psychologists. There is still much controversy about positive or negative effects of these games on cognitive performance. Executive functions are a set of cognitive abilities that play a decisive role in one’s purposeful behavior. The present study aims to investigate the effect of 2D and 3D video games on some of these functions—flexibility, inhibition, and continuous attention—in male students aged 18–26 years. Method Forty-five male students at Persian Gulf University participated in the study. They were matched based on intelligence score and experience of playing video games. The participants were divided into three groups of 15 (two experimental groups and one control group). Participants in the two experimental groups played 2D and 3D video games over 20 sessions. They completed the Wisconsin Card Sorting Test, continuous performance test, Stroop test, and Raven intelligence test. Results Data were analyzed via covariance and the results showed that playing 2D and 3D video games positively and significantly affects inhibition and playing 3D games has a significant positive effect on flexibility. Conclusion Based on our findings, we discuss the different effects of 2D and 3D video games, in line with the study’s theoretical framework, and give suggestions for future studies.