Temperature and light are important environmental factors for plant growth and development. The final two enzymes in the melatonin synthesis pathway in plants are serotonin N‐acetyltransferase (SNAT) and N‐acetylserotonin methyltransferase (ASMT), which have thermophilic characteristics. Thus, the effects of temperature and light on melatonin synthesis in rice seedlings were investigated. Here, we demonstrated that melatonin levels increased as temperature increased when rice seedlings were exposed to various temperatures for 1 hr. Moreover, the relative melatonin levels were higher in the dark. For example, exposure of rice seedlings to 1‐hr darkness at 55°C resulted in a melatonin yield of 4.9 ng/g fresh weight (fw), compared with 2.95 ng/g fw under light conditions. Temperature‐dependent melatonin synthesis was closely associated with an increase in both SNAT and ASMT activities, but not with transcript levels of melatonin biosynthetic genes. The daily melatonin levels in field‐grown rice plants were unaffected as the positive effect of the relatively high temperature during the day was counteracted by the negative effect of the high light. The opposite effect occurred during the night, in which the positive effect of darkness on melatonin synthesis was counteracted by the negative effect of a low temperature.