A new method for solving numerically stochastic partial differential equations (SPDEs) with multiple scales is presented. The method combines a spectral method with the heterogeneous multiscale method (HMM) presented in [W. E, D. Liu, E. Vanden-Eijnden, Analysis of multiscale methods for stochastic differential equations, Commun. Pure Appl. Math., 58(11) (2005) 1544-1585]. The class of problems that we consider are SPDEs with quadratic nonlinearities that were studied in [D. Blomker, M. Hairer, G.A. Pavliotis, Multiscale analysis for stochastic partial differential equations with quadratic nonlinearities, Nonlinearity, 20(7) (2007) 1721-1744]. For such SPDEs an amplitude equation which describes the effective dynamics at long time scales can be rigorously derived for both advective and diffusive time scales. Our method, based on micro and macro solvers, allows to capture numerically the amplitude equation accurately at a cost independent of the small scales in the problem. Numerical experiments illustrate the behavior of the proposed method. (C) 2011 Elsevier Inc. All rights reserved.