We calculate the binding energies of donors bound to X valleys in type-II GaAs–AlAs quantum well structures using an anisotropic variational method which enables us to take into account the effective mass anisotropy and quantum confinement. For a comparative study, we use two sets of effective masses obtained from different measurements [B. Rheinänder et al. Phys. Status Solidi B 49, K167 (1972) and M. Goiran et al., Physica B 177, 465 (1992)]. We show that the binding energies have a pronounced dependence with the effective mass, AlAs layer thickness, and impurity position.