Energy levels of ground and excited shallow acceptor states in the presence of an external magnetic field have been calculated for center-doped GaAs/AlxGa1-xAs quantum wells (QW's). The impurity states are calculated within a four-band effective-mass theory, in which the valence-band mixing as well as the mismatch of the band parameters and the dielectric constants between well and barrier materials have been taken into account. The g factors of the shallow acceptor 1s3/2 ground states and the 2P3/2 excited states are obtained for QW's with different well widths. The infrared optical transitions corresponding to the G, D, and C lines of acceptors in bulk GaAs have also been calculated versus magnetic fields up to 16 T for the case of acceptors confined in QW's.