This paper presents a measurement of the triple-differential cross section for the Drell-Yan process Z/γ* → ℓ+ℓ− where ℓ is an electron or a muon. The measurement is performed for invariant masses of the lepton pairs, mℓℓ, between 46 and 200 GeV using a sample of 20.2 fb−1 of pp collisions data at a centre-of-mass energy of s=8 TeV collected by the ATLAS detector at the LHC in 2012. The data are presented in bins of invariant mass, absolute dilepton rapidity, |yℓℓ|, and the angular variable cos θ* between the outgoing lepton and the incoming quark in the Collins-Soper frame. The measurements are performed in the range |yℓℓ| < 2.4 in the muon channel, and extended to |yℓℓ| < 3.6 in the electron channel. The cross sections are used to determine the Z boson forward-backward asymmetry as a function of |yℓℓ| and mℓℓ. The measurements achieve high-precision, below the percent level in the pole region, excluding the uncertainty in the integrated luminosity, and are in agreement with predictions. These precision data are sensitive to the parton distribution functions and the effective weak mixing angle.