We study the decoherence of a single electron spin in an isolated quantum dot induced by hyperfine interaction with nuclei. The decay is caused by the spatial variation of the electron wave function within the dot, leading to a nonuniform hyperfine coupling A. We evaluate the spin correlation function and find that the decay is not exponential but rather power (inverse logarithm) lawlike. For polarized nuclei we find an exact solution and show that the precession amplitude and the decay behavior can be tuned by the magnetic field. The decay time is given by (planck)N/A, where N is the number of nuclei inside the dot, and the amplitude of precession decays to a finite value. We show that there is a striking difference between the decoherence time for a single dot and the dephasing time for an ensemble of dots.