We perform a detailed study of the sensitivity to the anisotropies related to dark matter (DM) annihilation in the isotropic gamma-ray background (IGRB) as measured by the Fermi Large Area Telescope (Fermi LAT). For the first time, we take into account the effects of the Galactic foregrounds and use a realistic representation of the Fermi LAT. We implement an analysis pipeline which simulates Fermi LAT data sets starting from model maps of the Galactic foregrounds, the Fermi-resolved point sources, the extragalactic diffuse emission and the signal from DM annihilation. The effects of the detector are taken into account by convolving the model maps with the Fermi LAT instrumental response. We then use the angular power spectrum to characterize the anisotropy properties of the simulated data and to study the sensitivity to DM. We consider DM anisotropies of extragalactic origin and of Galactic origin (which can be generated through annihilation in the Milky Way substructures) as opposed to a background of anisotropies generated by sources of astrophysical origin, blazars for example. We find that with statistics from 5 yr of observation, Fermi is sensitive to a DM contribution at the level of 1–10 per cent of the measured IGRB depending on the DM mass mχ and annihilation mode. In terms of the thermally averaged cross-section 〈σAv〉, this corresponds to ∼10−25 cm3 s−1, i.e. slightly above the typical expectations for a thermal relic, for low values of the DM mass mχ≲ 100 GeV. The anisotropy method for DM searches has a sensitivity comparable to the usual methods based only on the energy spectrum and thus constitutes an independent and complementary piece of information in the DM puzzle.