Context. Gas-phase complex organic molecules are commonly detected in the warm inner regions of protostellar envelopes, so-called hot cores. Recent models show that photochemistry in ices followed by desorption may explain the observed abundances. There is, however, a general lack of quantitative data on UV-induced complex chemistry in ices. Aims. This study aims to experimentally quantify the UV-induced production rates of complex organics in CH3OH-rich ices under a variety of astrophysically relevant conditions. Methods. The ices are irradiated with a broad-band UV hydrogen microwave-discharge lamp under ultra-high vacuum conditions, at 20–70 K, and then heated to 200 K. The reaction products are identified by reflection-absorption infrared spectroscopy (RAIRS) and temperature programmed desorption (TPD), through comparison with RAIRS and TPD curves of pure complex species, and through the observed effects of isotopic substitution and enhancement of specific functional groups, such as CH3, in the ice. Results. Complex organics are readily formed in all experiments, both during irradiation and during the slow warm-up of the ices after the UV lamp is turned off. The relative abundances of photoproducts depend on the UV fluence, the ice temperature, and whether pure CH3OH ice or CH3OH:CH4/CO ice mixtures are used. C2H6, CH3CHO, CH3CH2OH, CH3OCH3, HCOOCH3, HOCH2CHO and (CH2OH)2 are all detected in at least one experiment. Varying the ice thickness and the UV flux does not affect the chemistry. The derived product-formation yields and their dependences on different experimental parameters, such as the initial ice composition, are used to estimate the CH3OH photodissociation branching ratios in ice and the relative diffusion barriers of the formed radicals. At 20 K, the pure CH3OH photodesorption yield is 2.1(±1.0) × 10−3 per incident UV photon, the photo-destruction cross section 2.6(±0.9) × 10−18 cm. Conclusions. Ice photochemistry in CH3OH ices is efficient enough to explain the observed abundances of complex organics around protostars. Some complex molecules, such as CH3CH2OH and CH3OCH3, form with a constant ratio in our ices and this can can be used to test whether 2 Karin I. Öberg et al.: Formation of complex organics in CH3OH ice complex gas-phase molecules in astrophysical settings have an ice-photochemistry origin. Other molecular ratios, e.g. HCO-bearing molecules versus (CH2OH)2, depend on the initial ice composition and temperature and can thus be used to investigate when and where complex ice molecules form.