Most studies have theoretically and experimentally investigated the effects of single‐element C/N/S doping on the magnetic and photocatalytic properties of three‐dimensional TiO2. However, only a few comparative studies are available on the magnetic and photocatalytic properties of two‐dimensional anatase TiO2 doped with C, N, or S. Based on the density functional theory framework, generalized gradient approximation + U method of the first principles is used to investigate the effects of doping three nonmetallic elements (C/N/S) on the magnetic and photocatalytic properties of bilayer anatase TiO2. The bilayer Ti24O47N (001) is found to have the lowest formation energy, the largest cohesion energy, is relatively stable, and exhibits magnetic property with a magnetic moment of −1.0 . The holes and electrons of Ti24O47N (001) system have longest carrier lifetime. The ratio of their average effective masses is 1.28, and the carrier separation in this system is good. The system is most favorable for the preparation of H2 and O2 from water decomposition. Within the 420–790 nm wavelength range, the Ti24O47N (001) system shows the strongest absorption spectrum intensity, the most prominent redshift, and the best activity. Thus, the bilayer Ti24O47N (001) system is an optimal photocatalyst.