Abstract Background Temperature is involved in the regulation of carotenoid accumulation in many plants. The floral color of sweet osmanthus (Osmanthus fragrans Lour.) which is mainly contributed by carotenoid content, is affected by temperature in autumn. However, the mechanism remains unknown. Here, to reveal how temperature regulates the floral color of sweet osmanthus, potted sweet osmanthus ‘Jinqiu Gui’ were treated by different temperatures (15 °C, 19 °C or 32 °C). The floral color, carotenoid content, and the expression level of carotenoid-related genes in petals of sweet osmanthus ‘Jinqiu Gui’ under different temperature treatments were investigated. Results Compared to the control (19 °C), high temperature (32 °C) changed the floral color from yellow to yellowish-white with higher lightness (L*) value and lower redness (a*) value, while low temperature (15 °C) turned the floral color from yellow to pale orange with decreased L* value and increased a* value. Total carotenoid content and the content of individual carotenoids (α-carotene, β-carotene, α-cryptoxanthin, β-cryptoxanthin, lutein and zeaxanthin) were inhibited by high temperature, but were enhanced by low temperature. Lower carotenoid accumulation under high temperature was probably attributed to transcriptional down-regulation of the biosynthesis gene OfPSY1, OfZ-ISO1 and OfLCYB1, and up-regulation of degradation genes OfNCED3, OfCCD1-1, OfCCD1-2, and OfCCD4-1. Up-regulation of OfLCYB1, and down-regulation of OfNCED3 and OfCCD4-1 were predicted to be involved in low-temperature-regulated carotenoid accumulation. Luciferase assays showed that the promoter activity of OfLCYB1 was activated by low temperature, and repressed by high temperature. However, the promoter activity of OfCCD4-1 was repressed by low temperature, and activated by high temperature. Conclusions Our study revealed that high temperature suppressed the floral coloration by repressing the expression of carotenoid biosynthesis genes, and activating the expression of carotenoid degradation genes. However, the relative low temperature had opposite effects on floral coloration and carotenoid biosynthesis in sweet osmanthus. These results will help reveal the regulatory mechanism of temperature on carotenoid accumulation in the petals of sweet osmanthus.