We present an asymptotically fast algorithm for the numerical evaluation of modular functions such as the elliptic modular function j. Our algorithm makes use of the natural connection between the arithmetic-geometric mean (AGM) of complex numbers and modular functions. Through a detailed complexity analysis, we prove that for a given τ, evaluating N significative bits of j(τ) can be done in time O(M(N) log N), where M(N) is the time complexity for the multiplication of two N-bit integers. However, this is only true for a fixed τ and the time complexity of this first algorithm greatly increases as Im(τ) does. We then describe a second algorithm that achieves the same time complexity independently of the value of τ in the classical fundamental domain F. We also show how our method can be used to evaluate other modular forms, such as the Dedekind η function, with the same time complexity.