We have obtained the energies and the wave functions for two-dimensional (2D) excitons in magnetic fields for the ground and several excited states, using an exact numerical integration of the Schr\"odinger equation for 2D excitons in a magnetic field. The results of the exact calculation for the ground-state energy and wave functions are in excellent agreement with those of variational and perturbation calculations except at intermediate fields where \ensuremath{\gamma}=(\ensuremath{\Elzxh}${\ensuremath{\omega}}_{c}$/2R) is of order 10. Here, R is the exciton Rydberg unit and ${\ensuremath{\omega}}_{c}$ is the cyclotron frequency of the exciton. Results are presented for the position of the exciton peak and the magnetoabsorption as a function of the field for 2D excitons.